home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / pwrbat23.zip / POWERBAT.DOC < prev    next >
Text File  |  1996-05-09  |  124KB  |  5,120 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.                                   PowerBatch
  11.                                   Version 2.3
  12.  
  13.  
  14.  
  15.                          COMPUTING SYSTEMS DESIGN, INC.
  16.                                  P.O. Box 9213
  17.                              Jupiter, FL 33468-9213
  18.                         Internet 72701.155@compuserve.com
  19.  
  20.  
  21.                       Copyright (c) 1990-1993 by CSD, Inc.
  22.                          All Rights Reserved Worldwide
  23.  
  24.                This documentation was produced on May 9, 1996
  25.  
  26.  
  27.  
  28.  
  29.  
  30.                                Table Of Contents
  31.  
  32.  
  33.                 Introduction   . . . . . . . . . . . . . . . . . . . . . . .  1
  34.  
  35.                 Software Support   . . . . . . . . . . . . . . . . . . . . .  3
  36.  
  37.                 Concept Of Operation   . . . . . . . . . . . . . . . . . . .  4
  38.  
  39.                 Installation   . . . . . . . . . . . . . . . . . . . . . . .  6
  40.  
  41.                 Constructing A PowerBatch Source File  . . . . . . . . . . .  7
  42.  
  43.                 PowerBatch Commands  . . . . . . . . . . . . . . . . . . . .  9
  44.  
  45.                 Command Summary  . . . . . . . . . . . . . . . . . . . . . . 85
  46.  
  47.                 Compilation Errors   . . . . . . . . . . . . . . . . . . . . 87
  48.  
  49.                 Examples   . . . . . . . . . . . . . . . . . . . . . . . . . 90
  50.  
  51.  
  52.  
  53.  
  54.  
  55.                                   Introduction
  56.         This product was originally written in late 1989 to provide the user
  57.         an alternative to the standard DOS batch files, an alternative that
  58.         produced standalone executable .EXE programs. The original command set
  59.         was aimed primarily at providing capabilities that solved the classic
  60.         "batch" type application.
  61.  
  62.         Requests from current users of the product and a desire to provide
  63.         additional capabilities beyond these requests have driven the product
  64.         far beyond original expectations. This product has become not only a
  65.         replacement for solving the classic batch application, but a very high
  66.         level language capable of creating sophisticated applications.
  67.  
  68.         PowerBatch compiled programs create all the details that are necessary
  69.         to create a professional microcomputer program.
  70.         This product is intended to provide a novice or beginning programmer
  71.         the capability of producing non-trivial programs with a high success
  72.         rate AND providing the experienced programmer with a tool which makes
  73.         quick work of the task of prototyping new applications.
  74.  
  75.         Trademarks
  76.         ==========
  77.         PowerBatch is a trademark of Computing Systems Design(CSD), Inc.
  78.         MS-DOS is a trademark of MicroSoft Corporation.
  79.         IBM and PC-DOS are trademarks of IBM Corporation.
  80.  
  81.  
  82.         License Agreement
  83.         =================
  84.         a. You are granted a personal, non-transferable and  non-exclusive
  85.         license to use the Program under the terms stated in this Agreement. 
  86.         Title and ownership of the Program and documentation remain in CSD,
  87.         Inc.;
  88.  
  89.         b. the Program may be used by you, your employees, or your agents only
  90.  
  91.  
  92.                                     Page 1
  93.  
  94.  
  95.  
  96.  
  97.  
  98.         on a single computer;
  99.  
  100.         c. you and your employees and agents are required to protect the
  101.         confidentiality of the Program. You may not distribute or otherwise
  102.         make the Program or documentation available to any third party;
  103.  
  104.         d. you may not copy or reproduce the Program or documentation for any
  105.         purpose, except you may copy the Program into machine readable or
  106.         printed form for backup purposes in support of your use of the
  107.         Program. (Any portion of this Program merged into or used in
  108.         conjunction with another program will continue to be the property of
  109.         CSD, Inc. and subject to the terms and condition of this Agreement);
  110.  
  111.         e. you may not assign or transfer this Program or this license to any
  112.         other person without the express prior consent of CSD, Inc.;
  113.  
  114.         f. you acknowledge that you are receiving only a limited license to
  115.         use the program and the related documentation. You acknowledge that
  116.         CSD, Inc. retains title to the Program and documentation.  You
  117.         acknowledge that CSD, Inc. has a valuable proprietary interest in the
  118.         Program and documentation; and
  119.  
  120.         You must reproduce and include the copyright notice on any copy,
  121.         modification or portion merged into another program with the exception
  122.         of compiled executable modules produced from your own source input. 
  123.         You may modify the Program for your own use, entirely at your own
  124.         risk, provided that the Program is used as specified in Section (b) of
  125.         this Agreement.
  126.  
  127.         Output from the PowerBatch compiler generated from original source code
  128.         become the property of the license holder and CSD, Inc. retains no
  129.         rights nor demands any royalty from their use.
  130.  
  131.         YOU MAY NOT USE, MODIFY, OR TRANSFER THE PROGRAM, OR ANY COPY,
  132.         MODIFICATION OR MERGED PORTION, IN WHOLE OR IN PART, EXCEPT AS
  133.         EXPRESSLY PROVIDED FOR IN THIS LICENSE.
  134.  
  135.         IF YOU TRANSFER POSSESSION OF ANY COPY, MODIFICATION OR MERGED PORTION
  136.         OF THE PROGRAM TO ANOTHER PARTY, YOUR LICENSE IS AUTOMATICALLY
  137.         TERMINATED.
  138.  
  139.         TERM
  140.         The license is effective until terminated.  You may terminate it at
  141.         any other time by destroying the Program together with all copies,
  142.         modifications and merged portion in any form.  It will also terminate
  143.  
  144.  
  145.                                     Page 2
  146.  
  147.  
  148.  
  149.  
  150.  
  151.         upon conditions set forth elsewhere in the Agreement or if you fail to
  152.         comply with any term or condition of the Agreement.  You agree upon
  153.         such termination to destroy the Program together with all copies,
  154.         modifications and merged portions in any form.
  155.  
  156.         Software Support
  157.         ================
  158.         Support for PowerBatch may be obtained by contacting CSD, Inc. on
  159.         Compuserve using Compuserve Mail (EasyPlex). Address inquiries to
  160.         Compuserve ID 72701,155. Internet address 72701.155@compuserve.com
  161.         If you are not a Compuserve member, you may obtain support by writing
  162.  
  163.                             Computing Systems Design, Inc.
  164.                                     P.O. Box 9213
  165.                                 Jupiter, FL 33468-9213
  166.                                            
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.                                     Page 3
  199.  
  200.  
  201.  
  202.  
  203.  
  204.                               Concept Of Operation
  205.  
  206.         PowerBatch is a compiler for a very high level language. A high level
  207.         language is one which requires a small number of commands to generate
  208.         code to perform a task. This is at the opposite end of the spectrum
  209.         from a low level language which requires a large number of commands to
  210.         perform a specified task. Low level languages allow the programmer to
  211.         operate at the "bits and bytes" level but generally requires a high
  212.         level of familiarity with both the computer and the language itself.
  213.         Low level languages generally produce code segments that are of
  214.         minimum size and maximum speed. High level languages produce solutions
  215.         that are easier and quicker to develop with some compromise in size
  216.         and speed.
  217.  
  218.         PowerBatch has attempted to make development of executable modules as
  219.         easy as possible and produce modules that are fast in execution. Power
  220.         Batch is a development tool that will allow experienced programmers to
  221.         develop applications in a minimum of time. It is designed to introduce
  222.         non-programmers to the creative world of programming. Error checking
  223.         and all the details that the experienced programmer builds into a
  224.         professional program are included automatically in every PowerBatch
  225.         compiled module.
  226.  
  227.         In addition to the more than 100 commands in the PowerBatch language,
  228.         any valid executable command (.EXE & .COM) as well as any of the DOS
  229.         intrinsic commands are valid within a PowerBatch source file and will be
  230.         "compiled". These .EXE, .COM and DOS intrinsic commands will be
  231.         executed via a shell and the PowerBatch .EXE program will continue
  232.         execution with the next compiled statement following the shelled
  233.         command. There are two main modules supplied with PowerBatch;
  234.         1)POWERMAK.EXE and 2)SMLMODEL.MDL. POWERMAK reads,parses the source file
  235.         and compiles the source code extracting routines from SMLMODEL. The
  236.         result is a completely standalone .EXE file that executes without
  237.         SMLMODEL or PowerBatch.
  238.  
  239.         PowerBatch commands fall into 5 classes of commands;
  240.  
  241.               1) Commands which provide systems information. These commands
  242.               provide the current color settings, the current date, the
  243.               current time, check for the existence of a valid drive letter,
  244.               and commands which check for the existence of a directory or a
  245.               file.
  246.  
  247.               2) Commands which control the flow of the program. Execute
  248.               different portions of the program based on existence or non-
  249.  
  250.  
  251.                                     Page 4
  252.  
  253.  
  254.  
  255.  
  256.  
  257.               existence of directories or files. Compare the contents of one
  258.               variable with the contents of another variable or a constant
  259.               and execute different portions of the batch program based on
  260.               the results of the compare.
  261.  
  262.               3) Commands which read and write strings of text.  These strings
  263.               of text may be "records" written to a disk as a file or
  264.               elements of an array written to a dynamically expanding array
  265.               in the memory area outside of the compiled program.
  266.  
  267.               4) Commands which provide string manipulation. Change a string to
  268.               all upper case characters, or all lower case characters.
  269.               Extract a portion of a string such as the first three
  270.               characters or the last four characters. Build a new string from
  271.               two existing strings by concatenation of the two strings.
  272.  
  273.               5) Commands which deal with screen writing and input from the
  274.               keyboard. These commands are the main power in the PowerBatch
  275.               system. Directly address any position on the screen and move
  276.               the cursor to that position to read or write text.
  277.               Automatically center a message or title on any line. Draw boxes
  278.               around portions of the screen to enhance screen appearance.
  279.               Read a single key from the keyboard, read the response to a
  280.               query that only accepts a yes or no response, read a string of
  281.               characters from the keyboard with a specified maximum length,
  282.               and read keys from the keyboard automatically changing the
  283.               characters to upper case.
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.                                     Page 5
  305.  
  306.  
  307.  
  308.  
  309.  
  310.                                      Installation
  311.  
  312.         Installation is accomplished by executing the PBInstal program. It
  313.         seemed only fitting that this install program be a compiled PowerBatch
  314.         program.  The two main modules POWERMAK.EXE and SMLMODEL.MDL must be
  315.         located in the DOS path to allow you to compile PowerBatch programs from
  316.         any directory on your system. PowerBatch may be run on a system as small
  317.         as a single floppy drive system with 128K. There will be some limit to
  318.         the number of source statements that may be compiled on a system this
  319.         small as memory is dynamically allocated as compilation progresses. A
  320.         source file of several hundred statements can be compiled on a small
  321.         machine. The PBInstal program is strictly a file copy program. It will
  322.         ask you where you wish to place the PowerBatch files and copy them to
  323.         the specified directory. You may copy your own files to various
  324.         directories if you desire. You may even copy POWERMAK.EXE and
  325.         SMLMODEL.MDL to a directory not on your path if you desire. If you do
  326.         so, you may compile only from the directory containing these two
  327.         files.
  328.  
  329.         PowerBatch may be installed from either drive A or B.
  330.  
  331.         Place your PowerBatch installation disk in either drive A or drive B.
  332.         Change to the drive which contains the install disk by typing
  333.            A: <Enter>
  334.         or
  335.            B: <Enter>
  336.  
  337.         Run the installation program by entering
  338.         
  339.            PBINSTAL <Enter>
  340.  
  341.         Follow the onscreen instructions to copy both the compiler and the
  342.         example files to your disk. Remember that you must copy both
  343.         POWERMAK.EXE  and  SMLMODEL.MDL to a directory defined to be in the DOS
  344.         search path in order to compile programs from any directory. If you do
  345.         not place these programs in a directory on the search path, you will
  346.         be able to compile from only the directory where they reside.
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.                                     Page 6
  358.  
  359.  
  360.  
  361.  
  362.  
  363.                          Constructing A PowerBatch Source File
  364.  
  365.         Use your favorite text editor to create a printable ASCII file
  366.         containing PowerBatch source commands and DOS executable commands. A
  367.         printable ASCII file is one that may be typed to the screen (i.e. type
  368.         myfile.pwr <enter>) and the results printed on the screen contain only
  369.         the file contents. Most files created with a word processor are not
  370.         printable ASCII files unless you specify an ASCII file output option.
  371.  
  372.         Compile your source statements to create a .EXE executable module.
  373.         This is done using the PowerBatch compiler. The syntax is:
  374.  
  375.            POWERMAK MyFile [OutFile] [+M] [+O]
  376.  
  377.         PowerBatch assumes the extension of the input file to be .PWR (i.e.
  378.         MYFILE.PWR) and will create an output file of MYFILE.EXE if no OutFile
  379.         parameter is specified. The input source file may be any DOS name of
  380.         your choice (including the extension). You may also specify an output
  381.         file name of your choice but the extension will always be .EXE. If you
  382.         do not enter the input file name on the command line, the program will
  383.         prompt you for the name. You must at this time enter the complete name
  384.         including the extension.
  385.  
  386.         If you wish to generate a list of all literals, variables, and labels
  387.         used in your PowerBatch program, add +M to the end of the command line.
  388.         This variable map will be written to the [FileName].MAP file.
  389.  
  390.         If you
  391.         If you compile a program that has been compiled before and has generated
  392.         an .EXE file, you will be asked if you wish to replace this EXE file. To
  393.         compile in batch mode or to bypass this message use the overwrite parm
  394.         +O.
  395.  
  396.         If the compiler finds no compilation errors, the compiled version of
  397.         your source file will be generated. For an explanation of compilation
  398.         errors, see the section entitled "Compilation Errors". Compilation
  399.         errors appear on your screen as they are encountered and they are
  400.         written to a file named [FileName].MAP (i.e. if your input file name
  401.         is MYFILE.PWR, the error and map file will be MYFILE.MAP). The entire
  402.  
  403.  
  404.                                     Page 7
  405.  
  406.  
  407.  
  408.  
  409.  
  410.         source code is scanned each time you compile a PowerBatch program (i.e.
  411.         the compiler does not stop when an error is found, but attempts to
  412.         identify all errors on each pass). This means that some errors will be
  413.         the result of previous errors found in the source.
  414.  
  415.         If there are no compilation errors, the [FileName].MAP file will not
  416.         be created.
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.                                     Page 8
  458.  
  459.  
  460.  
  461.  
  462.  
  463.                                   PowerBatch Commands
  464.  
  465.         Commands, Variable Names, and Labels are not case sensitive.
  466.         Everything on the command source line is converted to upper case
  467.         except a literal which is enclosed within quotes. Either single
  468.         quotes(') or double quotes(") may be used to denote a literal.
  469.         Literals which are numeric such as color values, variable lengths,
  470.         etc. should not be enclosed in quotes. The compiler does evaluate each
  471.         literal (both alpha and numeric) in the same manner. The evaluation
  472.         process is 1) remove leading and trailing quotes if any, 2) attempt to
  473.         convert literal to numeric, 3) if numeric conversion is successful,
  474.         consider it a number, 4) if numeric conversion is unsuccessful,
  475.         consider it alpha numeric. This means that internally an operand of 3
  476.         and "3" will both be numeric.
  477.  
  478.         A semicolon which is not enclosed within quotes or a part of a command
  479.         is used to denote a comment. Semicolons which are part of a command
  480.         must not be preceded by a space. A comment begins with a semicolon
  481.         which follows a space not within quotes. Comments may appear anywhere
  482.         on the command line, but everything after a semicolon on a command
  483.         line is ignored. A comment may begin in column 1 by placing the
  484.         semicolon in column 1. The following are NOT comments:
  485.  
  486.            path=d:\;c:\util;c:\wp
  487.            path   "d:\;c:\util;c:\wp"
  488.            WriteLine   "Punctuation may be used within quotes;"
  489.  
  490.         These ARE comments:
  491.  
  492.            Variable ColorSave,3 ;save the original color
  493.            SetVar   Msg, ErrMsg ;set Msg to "Invalid input"
  494.  
  495.         The starting location on the command line of the command and the
  496.         operands is not important and tabs and spaces may be freely used for
  497.         readability.
  498.  
  499.         Variable names and command labels may be any length in the source but
  500.         are significant only through the first eight positions. This means
  501.         that any variable name or label that is equal in the first 8 positions
  502.         will be considered the same.
  503.  
  504.         Variables, Literals, and Labels
  505.  
  506.         Variables
  507.         A variable is a location in memory that you allocate and give a name
  508.  
  509.  
  510.                                     Page 9
  511.  
  512.  
  513.  
  514.  
  515.  
  516.         and a maximum length. Anytime you refer to the "name" of the variable,
  517.         you are referencing the memory locations set aside for this variable.
  518.         Variable names give you an easy way to manipulate data internally
  519.         within the computer. The following are examples of variables:
  520.  
  521.            Variable    CharIn,1
  522.  
  523.         This variable gives the name "CharIn" to one memory position. It might
  524.         be used to hold one character responses from the keyboard by the user.
  525.  
  526.  
  527.            Variable    PBDir,79
  528.  
  529.         This variable appears in the PBInstal program and holds the name of
  530.         the directory where the PowerBatch compiler will be placed. It is
  531.         composed of the drive letter and directory entered by the user in
  532.         response to two questions during the installation process.
  533.  
  534.            Variable    CompName,35,"The ABC Company"
  535.  
  536.         This variable reserves 35 positions in memory and gives these
  537.         locations the name CompName. The PowerBatch compiler also places the
  538.         initial value "The ABC Company" in the first 15 positions of the
  539.         variable. The value of this variable may be changed by later
  540.         processing in the program. When this variable is referenced in the
  541.         program it will contain only 15 characters (The ABC Company) with no
  542.         leading or trailing spaces, assuming the program has not assigned a
  543.         new value.
  544.  
  545.            Variable    MsgClear,20,"                    "
  546.  
  547.         This variable contains 20 spaces and is named MsgClear. It will be
  548.         used to "clear" or overwrite with spaces an error message in your
  549.         program. Once you have displayed a message to the user, it should be
  550.         cleared as you continue with the program. This is done by overwriting
  551.         with spaces. Having a variable with the correct number of spaces makes
  552.         this task easier.
  553.  
  554.  
  555.  
  556.         Literals
  557.         Literals are very much like variables which have a value but no name.
  558.         Literals are used in PowerBatch commands when you wish to pass an actual
  559.         value to the command instead of a variable. Note in the following
  560.         examples that literals containing numbers only are not enclosed in
  561.  
  562.  
  563.                                     Page 10
  564.  
  565.  
  566.  
  567.  
  568.  
  569.         quotes and literals containing any non-numeric characters are enclosed
  570.         in quotes. If you specify a number as a literal, either convention is
  571.         acceptable (3 or "3"). If you specify alphabetic characters, the
  572.         quotes are required. For readability, and ease of entry, numeric
  573.         literals usually do not contain quotes. Examine the following examples
  574.         of literals:
  575.  
  576.            Center      "Installation Program",1
  577.  
  578.         This command will center the literal "Installation Program" on line 1
  579.         of the screen. The text "Installation Program" must appear somewhere
  580.         in the program and it appears as a literal. It will occupy memory
  581.         positions and will have a value but you may not reference this value
  582.         by name. By instructing the compiler to write this literal, the
  583.         compiler automatically creates the memory locations and initial value
  584.         but gives it no name. The 1 is also a literal in this command. Each
  585.         time you use a literal in a PowerBatch program, the previously assigned
  586.         literals are checked for duplication and if the literal has been
  587.         previously assigned, the prior assignment will be used (i.e. literal
  588.         values will appear only one time regardless of the number of times
  589.         used).
  590.  
  591.            WriteAt     12,3,Msg1
  592.  
  593.         There are two literals in this command. The numbers 12 and 3 are both
  594.         created as literals. In this command they specify the column and row
  595.         location where the string Msg1 will be written. Again, the compiler
  596.         creates the memory locations and values for these literals, but no
  597.         names. If you were to write another command such as the Beep command
  598.         which specifies that the system speaker will beep at a certain
  599.         frequency for 3 times, the compiler will find the previously defined
  600.         literal "3" and use this value instead of creating another literal.
  601.  
  602.            Beep        ErrTone,8,3
  603.  
  604.         This is the Beep command referenced in the previous example. The beep
  605.         command will cause the speaker to sound at a frequency of ErrTone for
  606.         .8 second and repeat 3 times. The "3" literal will use the same memory
  607.         location reference as the WriteAt command used in the previous command
  608.         (i.e. another literal will not be created).
  609.  
  610.         Labels
  611.  
  612.  
  613.  
  614.  
  615.  
  616.                                     Page 11
  617.  
  618.  
  619.  
  620.  
  621.  
  622.         Labels are names of a particular place in your PowerBatch program that
  623.         you will go to without executing the previous command. You go directly
  624.         to this location in the program from another location in the program
  625.         based on a decision you have made in the code flow. Examples will help
  626.         explain:
  627.  
  628.            ReadYN      "Do you wish to continue [Y/N] ",InChar
  629.            Compare     InChar,"Y",,,GetDrive
  630.            Halt        999      ;end the program if "N"
  631.  
  632.            Label       GetDrive
  633.  
  634.         This group of commands writes the message on the screen and asks the
  635.         user to input either Y or N (the command will only accept these two
  636.         characters). A comparison is then made to a literal "Y" and the
  637.         compare command will jump to the location in the program named
  638.         GetDrive if a "Y" was entered or will execute the next command if "N"
  639.         was entered.
  640.            GoTo        NextCmd
  641.            .
  642.            .
  643.            .
  644.            Label       NextCmd
  645.  
  646.         In this most straightforward use of the label, the user simply uses
  647.         the GoTo command and jumps unconditionally to another point in the
  648.         program.
  649.  
  650.         External Commands
  651.         External commands are entered just as PowerBatch commands are entered.
  652.         If you enter an external command and this command uses command line
  653.         parameters, these parameters may be passed as either variables or
  654.         literals. Remember that if the parameter is not numeric, it must be
  655.         enclosed in quotes or it will be treated as a variable. Any PowerBatch
  656.         statement which is an external command may contain a maximum of 7
  657.         command line variables. That is not to say that you may not pass more
  658.         than 7 command line parameters to an external program but that these
  659.         command line variables may not be contained in more that 7 PowerBatch
  660.         variables.
  661.  
  662.         For example:
  663.            Variable Parm1,5,"one"
  664.            Variable Parm2,5,"two"
  665.            Variable Parm3,5,"three"
  666.            Variable Parm4,5,"four"
  667.  
  668.  
  669.                                     Page 12
  670.  
  671.  
  672.  
  673.  
  674.  
  675.                            Variable Parm5,5,"five"
  676.            Variable Parm6,5,"six"
  677.            Variable Parm7,5,"seven"
  678.            Variable Parm8,5,"eight"
  679.            Variable BigParm,80
  680.  
  681.            ExtPgm   (Name of an external program)
  682.          
  683.         A valid method for passing these parms in one PowerBatch parameter.
  684.  
  685.            Extpgm   "one two three four five six seven eight"
  686.  
  687.         Accomplishing the same thing with variables using 6 PowerBatch parms.
  688.  
  689.            Concat   BigParm,Parm1," "
  690.            Concat   BigParm,Parm2
  691.            Concat   BigParm," "
  692.            Concat   BigParm,Parm3
  693.            ExtPgm   BigParm,Parm4,Parm5,Parm6,Parm7,Parm8
  694.  
  695.         Examples of external programs as PowerBatch commands:
  696.  
  697.            Variable    InChar,1
  698.            ReadYN      "Do you wish a directory ",InChar
  699.            Compare     InChar,"Y",NextSec,NextSec
  700.            DIR         "/W"
  701.            SETUP    "> null"    ;printer redirection
  702.  
  703.            Variable    PgmName,12
  704.            Write    "Enter program name to compile "
  705.            ReadStr     PgmName
  706.            TPC         PgmName, "/ddebug"
  707.  
  708.         This third example of external commands show the use of two predefined
  709.         variables, ERRORLEVEL and DOSERROR. After the execution of "TestPgm",
  710.         we examine DOSError to find if the program executed OK (Possibly there
  711.         was not enough memory or the program could not be found on the DOS
  712.         path). After determining that the program executed OK, we examine the
  713.         exit code set by "TestPgm" to determine the flow of the remainder of
  714.         our program. This exit code will be found in the variable ERRORLEVEL.
  715.  
  716.            Variable    MsgLine,80
  717.            .
  718.            .
  719.            TestPgm     "Parm1 Parm2"
  720.  
  721.  
  722.                                     Page 13
  723.  
  724.  
  725.  
  726.  
  727.  
  728.                            Compare     DOSError,0,,,RanOK
  729.            WriteLine      "TestPgm did not execute properly"
  730.            Halt        DOSError
  731.            Label    RanOK
  732.            Compare     ErrorLevel,1,Chk2,,Option1
  733.            Concat      MsgLine,"Unexpected code : ",ErrorLevel
  734.            Halt
  735.            Label       Option1
  736.  
  737.         Note: PowerBatch programs may be executed by other PowerBatch programs as
  738.         external commands. An option of the PowerBatch Halt command is to set
  739.         the DOS errorlevel. You could then "pass parameters" from one PowerBatch
  740.         program to another via the ERRORLEVEL variable.
  741.  
  742.         Command Line Parameters
  743.         Command line parameters may be passed to a compiled PowerBatch program.
  744.         These command line parameters must be defined at compile time and have
  745.         special variable names. Up to 16 parameters may be passed to a
  746.         PowerBat program. These parameters are named CLP%1 - CLP%16.
  747.         If you wish to pass parameters on the command line to your PowerBatch
  748.         program, define the command line parameter variables (CLP%1 - CLP%16)
  749.         in your PowerBatch source prior to compilation and when you run the
  750.         compiled program, any parameters entered on the command line will be
  751.         in the defined variable. Example:
  752.  
  753.            Source for SMARTCPY.PWR
  754.  
  755.            Variable    CLP%1,79    ;source file
  756.            Variable    CLP%2,79    ;target file
  757.            Variable    InChar,1
  758.            ReadYN      "Ready to copy the files [Y/N] ",InChar
  759.            Compare     InChar,"Y",NoCopy,NoCopy
  760.            COPY        CLP%1, CLP%2
  761.  
  762.         SMARTCPY FILE1 FILE2 will execute the DOS copy command and copy FILE1
  763.         to FILE2 if the user responds Y to the question.
  764.  
  765.         Changing Environment Variables
  766.  
  767.         Your computer memory contains a special area of memory called the
  768.         "Environment Area". This special area of memory contains the values
  769.         assigned to variables that are available to the DOS operating system
  770.         or to any application program running in your computer. These values
  771.         remain unchanged until DOS or an application program changes them. DOS
  772.         maintains special values in this area which the operating system uses.
  773.  
  774.  
  775.                                     Page 14
  776.  
  777.  
  778.  
  779.  
  780.  
  781.         Your current path and current prompt configuration are two of these
  782.         values. These values are normally set with the DOS PROMPT or PATH
  783.         command. If an application program like a compiled PowerBatch program
  784.         executes a DOS command, it is done via a "shell" or another copy of
  785.         your command processor (normally COMMAND.COM) which is started to
  786.         handle the execution of these DOS commands. When a shell is started,
  787.         DOS creates a copy of the environment area for this new shell and
  788.         makes the environment values available to the shell. Unfortunately,
  789.         when the shell is terminated (when the DOS command is complete) this
  790.         copy of the environment is erased from memory. If you execute a
  791.         PROMPT, PATH or SET [Variable] command, the copy of the environment
  792.         created for the shell to run the PROMPT, PATH, or SET command is
  793.         updated and immediately erased when the PowerBatch program is finished.
  794.         PowerBatch however, provides you a means to update both the permanent
  795.         copy and the current copy of the environment area with the commands
  796.         SETPATH, SETENV, and PROMPT.
  797.  
  798.         Unfortunately, problems dealing with the environment area do not end
  799.         here. When DOS runs a program (like a PowerBatch compiled program), a
  800.         copy of the permanent environment is made and is the "active"
  801.         environment area in use during the running of the program. If you only
  802.         read the values of existing environment variables, there is no
  803.         problem. If you attempt to add new environment values, the amount of
  804.         free environment space is very limited. IT IS NOT THE AMOUNT OF SPACE
  805.         ALLOCATED BY YOU IN YOUR CONFIG.SYS FILE (or the default) MINUS THE
  806.         AMOUNT OF USED SPACE! The amount of "free" space appears to be only
  807.         the amount left after rounding up the amount of used space to the
  808.         nearest paragraph of memory (16 bytes).
  809.         The problem of allocating environment free space can be circumvented
  810.         by updating the permanent environment area with dummy values prior to
  811.         the execution of your PowerBatch file. This could be done with a small
  812.         PowerBatch program such as ENV-INIT.PWR as follows:
  813.  
  814.            SetEnv   Env1,'dummy value dummy value'
  815.            SetEnv   Env2,'dummy value dummy value'
  816.            .
  817.            .
  818.            .
  819.         When ENV-INIT terminates, the environment variables Env1 and Env2 will
  820.         have the dummy values and will now be a part of any environment area
  821.         copy passed to a running program. You could of course use the DOS SET
  822.         command from the DOS command line or initialize the environment
  823.         variables with dummy values in your AUTOEXEC.BAT file.
  824.  
  825.         Command Notation
  826.  
  827.  
  828.                                     Page 15
  829.  
  830.  
  831.  
  832.  
  833.  
  834.         In the description of the commands which follow, that which appears
  835.         within brackets [ ] is optional and all other operands are required.
  836.         Any time a screen color may be specified in a command such as
  837.  
  838.            CLEARLINE LineNum,ForegrClr,BackgrClr
  839.  
  840.         the single attribute which is used in many color conventions may be
  841.         substituted for the pair of color attributes. For example, foreground
  842.         color 4 (red), background color 1 (blue), is identical to color
  843.         attribute 20 and the CLEARLINE command may be specified EITHER as 
  844.  
  845.            CLEARLINE 14,4,1
  846.         or
  847.            CLEARLINE 14,20
  848.  
  849.         to clear line 14 on the screen to red foreground on blue background.
  850.         For this reason anytime that the operand pair of foreground color,
  851.         background color is required, the single color attribute may be
  852.         substituted for the pair. The compiler will not detect missing
  853.         background color attributes but will assume that the foreground is the
  854.         composite value.
  855.  
  856.         How do I calculate this color attribute? The composite color attribute
  857.         is the DOS shorthand method of keeping both the foreground and
  858.         background colors in one byte of memory. It may be calculated by
  859.         multiplying the background color by 16 and adding the foreground
  860.         color. See Appendix B for a complete list of composite color
  861.         attributes.
  862.  
  863.         Color Attribute = (Backgrnd X 16) + Foregrnd
  864.         RedOnBlue = (1 X 16) + 4 = 20
  865.         WhiteOnBlack = (0 X 16) + 7 = 7
  866.         YellowOnRed = (4 X 16) + 14 = 78
  867.         DOS uses the ASCII values 0 through 127 for all the colors available.
  868.         To make any color blink, add 128 to the color value.
  869.  
  870.         YellowOnRed,Blinking = 78 + 128 = 206.
  871.  
  872.         Command Syntax
  873.  
  874.         Several examples are available on the distribution disk. All source
  875.         code examples have a file extension of .PWR. These examples may be
  876.         edited with your favorite text editor and printed by "copying" the
  877.         file to the printer such as COPY PBINSTAL.PWR LPT1.
  878.  
  879.  
  880.  
  881.                                     Page 16
  882.  
  883.  
  884.  
  885.  
  886.  
  887.                        ?COLOR Foreground, Background, Composite
  888.  
  889.         Retrieve the current color attributes from the system and place the
  890.         current foreground color in ForeGround, the current background color
  891.         in BackGround, and the composite attribute in Composite. The
  892.         relationship is Composite = (BackGround * 16) + ForeGround. See
  893.         Appendix B for complete list of composite color attributes.
  894.  
  895.               Variable ForeColor,3
  896.               Variable BackColor,3
  897.               Variable ColorAttr,3
  898.               ?Color   ForeColor,BackColor,ColorAttr
  899.  
  900.         Retrieve the current foreground, background and composite color values
  901.         and place in the variables ForeColor, BackColor, and ColorAttr
  902.         respectively. To create professional programs it is a good idea to
  903.         retrieve the current color setting as the first command in the program
  904.         and reset these values and clear the screen at the end of your
  905.         program. This restores the users computer to the same color state that
  906.         you found when your PowerBatch program was executed.
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.                                          Page 17
  935.  
  936.  
  937.  
  938.  
  939.  
  940.                           ?CURRDIR CurrDrive, CurrDirectory
  941.  
  942.         Retrieve the current drive and directory from the system and place the
  943.         current drive in CurrDrive and the current directory in CurrDirectory.
  944.         The contents of CurrDrive prior to execution of this command control
  945.         which drive is searched for the currently logged directory. If
  946.         ?CurrDir finds a valid drive letter in the first position of
  947.         CurrDrive, then the contents of CurrDirectory will be the currently
  948.         logged directory of that drive. If the first position of CurrDrive
  949.         does not contain a valid drive letter, then CurrDirectory will contain
  950.         the currently logged directory of the current drive. In either case
  951.         CurrDrive will contain the drive and CurrDirectory will contain the
  952.         directory.
  953.  
  954.            Variable    CurrDrive,2
  955.            Variable    CurrDir,79
  956.            SetVar      CurrDrive,"A"
  957.            ?CurrDir    CurrDrive,CurrDir
  958.            SetVar      CurrDrive,""
  959.            ?CurrDir    CurrDrive,CurrDir
  960.  
  961.         In the first usage of ?CurrDir, assuming that the currently logged
  962.         directory on the A drive is the root directory, CurrDrive will contain
  963.         "A" and CurrDir will contain "\" after the execution of ?CurrDir. In
  964.         the second usage, assuming that the currently logged drive is D: and
  965.         the currently logged directory on the D: drive is "\UTIL\EXEC",
  966.         CurrDrive will contain "D" and CurrDir will contain "\UTIL\EXEC" after
  967.         the execution of ?CurrDir.
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.                                     Page 18
  988.  
  989.  
  990.  
  991.  
  992.  
  993.                           ?DATE DayOfWeek, Month, Day, Year
  994.  
  995.         Retrieve the current date from the system and place the day of the
  996.         week in DayOfWeek, the month in Month, the day in Day, and the 4 digit
  997.         year in Year. DayOfWeek should be defined as 9 long, Month and Day as
  998.         2 long, and Year as 4 long.
  999.  
  1000.            Variable DOW,9
  1001.            Variable Mo,2
  1002.            Variable Da,2
  1003.            Variable Yr,4
  1004.            ?Date DOW,Mo,Da,Yr
  1005.  
  1006.         Retrieve the current date and place the component parts in their
  1007.         respective variables. Place the day of the week in DOW (i.e.
  1008.         Saturday), the month number in Mo (i.e. 06), the day of the month in
  1009.         Da (i.e. 29), and the year in Yr (i.e. 1993).
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.                                     Page 19
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.                       ?DIREXIST DirName, FoundLbl [,NotFoundLbl]
  1047.  
  1048.         Check the system for the existence of the directory whose name appears
  1049.         in DirName. If the directory exists go directly to the label FoundLbl,
  1050.         if the directory does not exist, go directly to the label NotFoundLbl.
  1051.         DirName may either be a variable or a literal. If NotFoundLbl is not
  1052.         specified, execution will continue with the next instruction
  1053.         immediately following the ?DirExist command.
  1054.  
  1055.            ?DirExist   InpStr,DirOk,BadDir
  1056.            ?DirExist   "C:\",DirOK,BadDir
  1057.            ?DirExist   InpStr,,BadDir  (next command if exists)
  1058.            ?DirExist   InpStr,DirOk    (next command if not exist)
  1059.  
  1060.         In the first example if the contents of the variable InpStr exists
  1061.         then goto label DirOK, if it does not exist go to the label BadDir. In
  1062.         the second example we check for the existence of a directory contained
  1063.         in the literal whose value is "C:\". In the third example, if the
  1064.         contents of InpStr exist we "fall through" to the next instruction, if
  1065.         the directory does not exist we jump to the label BadDir. In the
  1066.         fourth example, if the directory name in InpStr exists, we jump to the
  1067.         label DirOK, if it does not exist we fall through to the next command.
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.                                     Page 20
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.                                                ?DISKINFO DriveLetter, VolID, DriveType
  1100.  
  1101.         The volume ID is retrieved from the DriveLetter drive and the type of
  1102.         drive is determined and placed in DriveType. Volume ID may be a string
  1103.         of up to 12 characters. All disk media is not required to contain a
  1104.         Volume ID and in this case VolID will contain "No Label". The
  1105.         DriveType will be one of the following values:
  1106.            "360 Floppy"      "720 Floppy"      "1.2 Floppy"
  1107.            "1.4 Floppy"      "Other Floppy" "Bernoulli"
  1108.            "HardDisk"     "RamDisk"      "SubDrive"
  1109.            "Unknown"      "Invalid"
  1110.  
  1111.            Variable Drive,1,'D'
  1112.            Variable VolumeID,12
  1113.            Variable DriveType,12
  1114.  
  1115.            ?DiskInfo   Drive,VolumeID,DriveType
  1116.            Compare  DriveType,'RamDisk',,,RamOK
  1117.            Write Drive
  1118.            WriteLine   ' is not a RAM drive!'
  1119.            Halt
  1120.  
  1121.            Label RamOK
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.                                     Page 21
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.                     ?DISKSPACE DriveLetter, TotalSpace, FreeSpace
  1153.  
  1154.         Query the disk Drive specified by the first character of DriveLetter
  1155.         and place the total disk capacity in bytes in TotalSpace and the
  1156.         unused bytes in FreeSpace. Since the command looks at only the first
  1157.         character of DriveLetter, this parameter may contains strings such as
  1158.         "C:\UTIL". DriveLetter may be either a Variable or a Literal.
  1159.  
  1160.            Variable    DirName,79
  1161.            Write    'Enter your full pathname'
  1162.            ReadStr     DirName  (user enters "c:\util")
  1163.            ?DiskSpace  DirName,TotSpace,FreeSpace
  1164.  
  1165.         This will place the total capacity of drive C: in the variable
  1166.         TotSpace and the amount of this space that is unused in the variable
  1167.         FreeSpace.
  1168.  
  1169.            ?DiskSpace  "A",TotSpace,FreeSpace
  1170.  
  1171.         This retrieves the total capacity and free space for drive A:  using a
  1172.         literal of "A".
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.                                     Page 22
  1200.  
  1201.  
  1202.  
  1203.  
  1204.  
  1205.                  ?DRIVEEXIST DriveLetter, ValidLabel [,InvalidLabel]
  1206.  
  1207.         Check the system for DriveLetter as a valid drive. If the drive is
  1208.         valid, jump to Label1, if the drive is not valid, jump to Label2. If
  1209.         InvalidLabel is not specified, execution will continue with the next
  1210.         command immediately following the ?DriveExist command. DriveLetter may
  1211.         be either a variable or a literal.
  1212.  
  1213.            ?DriveExist DrvNum,GoodDrv,BadDrv
  1214.            ?DriveExist "A",GoodDrv,BadDrv
  1215.            ?DriveExist DrvNum,,BadDrv (falls thru if drive ok)
  1216.            ?DriveExist DrvNum,GoodDrv (falls thru if drive bad)
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.                                     Page 23
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.                        ?ENVSTR EnvironName, EnvironNameContents
  1259.  
  1260.         Retrieve the contents of any environment variable from the system
  1261.         environment area. The name of the environment variable is placed in
  1262.         EnvironName or entered as a literal and the contents of the
  1263.         environment variable will be placed in EnvironNameContents. Ensure
  1264.         that EnvironNameContents has been defined long enough to contain the
  1265.         contents of the environment variable. If EnvironNameContents is not
  1266.         long enough, the environment variable will be truncated. To display
  1267.         the currently defined environment variables, use the DOS "SET" command
  1268.         at a DOS prompt. (i.e. C:>SET <enter>) You should receive at least two
  1269.         environment variables (assuming you have set a path) with the format
  1270.         NAME=VALUE. The location of your command processor is in an
  1271.         environment variable named COMSPEC and should look something like
  1272.         this: COMSPEC=C:\COMMAND.COM.
  1273.  
  1274.            Variable    EnvValue,255
  1275.            Variable    EnvName,4,"path"
  1276.            ?EnvStr     "prompt", EnvValue
  1277.            ?EnvStr     EnvName, EnvValue
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.                                     Page 24
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.                    ?FILEEXIST FileName, FoundLabel [,NotFoundLabel]
  1312.  
  1313.         Check the system for the specified file name. If the file exists, jump
  1314.         to the label FoundLabel, if the file does not exist, jump to the label
  1315.         NotFoundLabel. If NotFoundLabel is not entered, execution will
  1316.         continue with the next command immediately following the ?FileExist
  1317.         command. If only a file name is entered (i.e. CONFIG.SYS), then only
  1318.         the current directory will be searched. If a fully qualified filename
  1319.         is entered (i.e. C:\CONFIG.SYS), then only the specified directory
  1320.         will be searched. FileName may be either a variable or a literal. See
  1321.         ?FileExpand.
  1322.  
  1323.            ?FileExist  FileName, Label1, Label2
  1324.            ?FileExist  "C:\AUTOEXEC.BAT",StartOK,NoStart
  1325.            ?FileExist  FileName,,NotFound
  1326.            ?FileExist  FileName,Found
  1327.  
  1328.         The two commands ?FileExist and ?FileExpand are identical with the
  1329.         exception that ?FileExist gives you the capability to limit your
  1330.         search to the current directory while ?FileExpand will attempt to find
  1331.         the file anywhere on the disk and tell you exactly where the file was
  1332.         found.
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.                                     Page 25
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.                   ?FILEEXPAND FileName, FoundLabel [,NotFoundLabel]
  1365.  
  1366.         Check the system for the specified file name. If the file exists, jump
  1367.         to the label FoundLabel, if the file does not exist, jump to the label
  1368.         NotFoundLabel. If NotFoundLabel is not entered, execution will
  1369.         continue with the next command immediately following the ?FileExist
  1370.         command. If FileName contains a drive and/or path in addition to the
  1371.         filename (i.e. C:\CONFIG.SYS or \CONFIG.SYS), the specified drive and
  1372.         directory is searched. If only a filename is placed in FileName, then
  1373.         the search contains the following: 1) the current directory, 2) the
  1374.         directory from which the compiled PowerBatch program was run, 3) all
  1375.         directories on the search path. (I try to find it in any directory on
  1376.         the disk which I know exists). If the file was found, the full path
  1377.         name\filename is placed in FileName. For this reason FileName must be
  1378.         a variable. Ensure that FileName is long enough to handle this full
  1379.         pathname!
  1380.  
  1381.            SetVar      FileName,'MYFILE.LTR'
  1382.            ?FileExist  FileName, Label1, Label2
  1383.  
  1384.         Assuming that MYFILE.DAT was located in "\WP60\LETTERS", the contents
  1385.         of FileName will be "C:\WP60\LETTERS\MYFILE.LTR".
  1386.  
  1387.            ?FileExist  "C:\AUTOEXEC.BAT",StartOK,NoStart
  1388.  
  1389.         ERROR! FileName cannot be a literal.
  1390.  
  1391.         The two commands ?FileExist and ?FileExpand are identical with the
  1392.         exception that ?FileExist gives you the capability to limit your
  1393.         search to the current directory while ?FileExpand will attempt to find
  1394.         the file anywhere on the disk and tell you exactly where the file was
  1395.         found.
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.                                     Page 26
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.                              ?FILESIZE FileSize, FileName
  1418.  
  1419.         The size in bytes of FileName is placed in FileSize. FileName may be
  1420.         either a variable or a literal. FileSize must be a variable.
  1421.  
  1422.            Variable FileSize,11
  1423.            Variable FileName,'AUTOEXEC.BAT'
  1424.  
  1425.            CD    'C:\'       ;change drive and dir
  1426.            ?FileSize   FileSize, FileName   ;find the filesize
  1427.            ?FileSize   FileSize, 'AUTOEXEC.BAT' ;same results
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464.                                     Page 27
  1465.  
  1466.  
  1467.  
  1468.  
  1469.  
  1470.                     ?INPATH DirName, FoundLabel, [,NotFoundLabel]
  1471.  
  1472.         Compare the contents of DirName to the system search path. If DirName
  1473.         is contained within the path, jump to the label FoundLabel, if DirName
  1474.         is not contained within the path, jump to the label NotFoundLabel. If
  1475.         NotFoundLabel is not specified, execution will continue with the
  1476.         command immediately following the ?InPath command. Use this command to
  1477.         determine if a directory is located in the DOS search path.
  1478.  
  1479.            DOS search path contains "C:\UTIL;C:\WORDPROC;D:\"
  1480.            Variable    InString,79
  1481.            Write    "Enter your directory name "
  1482.            ReadStr     InString (user enters "c:\wordproc")
  1483.            Upper    InString (change to "C:\WORDPROC")
  1484.            ?InPath     InString,PathOK,BadPath
  1485.  
  1486.            ?InPath     "C:\UTIL",,BadPath   (compare literal)
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.                                     Page 28
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.                                   ?TIME CurrentTime
  1524.  
  1525.         Retrieve the current time from the system and place in CurrentTime.
  1526.         The format of the time is hh:mm:ss xm. CurrentTime should be defined
  1527.         as 11 long.
  1528.  
  1529.            Variable CurrTime,11
  1530.            ?Time CurrTime (now contains 11:24:14 am)
  1531.  
  1532.  
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542.  
  1543.  
  1544.  
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.                                     Page 29
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.                         ADD Sum, Number, [RtnCode], [Decimals]
  1577.  
  1578.         Add the contents of Number to Sum and place the result in Sum. RtnCode
  1579.         will contain zero (0) if the add command completed without error.
  1580.         Decimals contains the number of decimal places for the result. If
  1581.         Decimals is not specified, zero decimal places will be assumed and
  1582.         integer arithmatic will be performed. Your Result will be rounded to
  1583.         the specified number of decimal places.  Accurate to 18 significant
  1584.         digits.
  1585.  
  1586.            Variable    YLoc,2
  1587.            SetVar      YLoc,6
  1588.            Label    LoopCtr
  1589.            ClearLine      YLoc,Blue
  1590.            Add         YLoc,1
  1591.            Compare     YLoc,11,LoopCtr
  1592.  
  1593.         This small code segment will clear lines 6 through 10 on your screen
  1594.         by incrementing the line number variable used by the ClearLine
  1595.         command.
  1596.  
  1597.         Using decimals with PowerBatch math...
  1598.  
  1599.            Variable    AcctBal,12,'127,854.94'
  1600.            Variable    RtnCode,1
  1601.            Add         AcctBal,'122.125',RtnCode,4
  1602.            Compare     RtnCode,0,ErrRtn
  1603.            Write    AcctBal     (contains 127977.065)
  1604.            Multiply    AcctBal,'.000325',RtnCode,6
  1605.            Compare     RtnCode,0,ErrRtn
  1606.            Write    AcctBal     (contains 41.592546)
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.                                     Page 30
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.                           BEEP Frequency, Duration [,Repeat]
  1630.  
  1631.         Sound the system speaker with a tone of Frequency, for a length of
  1632.         Duration tenths of a second, and repeat Repeat times.
  1633.  
  1634.            Beep  800,5,3
  1635.            Beep  ErrFreq,BeepLen,ErrTimes
  1636.  
  1637.         The first example sounds the system speaker at a frequency of 800 hz
  1638.         for half a second (.5) and repeats twice for a total of 3 times. The
  1639.         second example will sound the system speaker at a frequency equal to
  1640.         the contents of the variable ErrFreq for BeepLen tenths of a second(s)
  1641.         for a total of ErrTimes.
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.  
  1658.  
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  
  1665.  
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.                                     Page 31
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.                                         BLINK
  1683.  
  1684.         Cause all text that is written to the screen to blink using the
  1685.         current color attributes last defined in the processing of the your
  1686.         program. This command in "undone" by using NORMAL.
  1687.  
  1688.            Variable MsgClear,25."                         "
  1689.            Blink
  1690.            WriteAt  15,4,"Not a valid entry"
  1691.            Normal
  1692.            Wait     35
  1693.            WriteAt  15,4,MsgClear
  1694.  
  1695.         Write the message "Not a valid entry" at column 15 on row 4 using the
  1696.         current color definition. Reset the text color to the value it
  1697.         contained before specifying blinking text. Wait 3.5 seconds and clear
  1698.         the message.
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.                                     Page 32
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735.                                          BOOT
  1736.  
  1737.         This command will cause the computer to perform a "warm" boot. This
  1738.         emulates the pressing of the Alt-Ctrl-Del key combination.
  1739.  
  1740.            ReadYN   'Press Y to REBOOT your machine (Y/N) ',YNInput
  1741.            Compare  YNInput,'Y',NoBoot,NoBoot
  1742.            Boot
  1743.            Label NoBoot
  1744.  
  1745.  
  1746.  
  1747.  
  1748.  
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.                                     Page 33
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.                        BOXx UX, UY, LX, LY, ForeClr [,BackClr]
  1789.  
  1790.         Where Boxx is Box0 thru Box3. Draw a box (frame) on the screen whose
  1791.         upper left coordinates (X,Y) are UX,UY, and whose lower right
  1792.         coordinates (X,Y) are LX,LY. Draw the box using a line in foreground
  1793.         color ForeClr on background color BackClr. The border line for the box
  1794.         is:
  1795.            Box0 - No border
  1796.            Box1 - Single line
  1797.            Box2 - Double line
  1798.            Box3 - Heavy solid line.
  1799.         The interior of the box is cleared to the background color whether
  1800.         specified explicitly by the background color parameter or as a part of
  1801.         the composite color parameter. The cursor is positioned at UX+1, UY+1.
  1802.  
  1803.            Variable ULX,2,5     ;upper left col value
  1804.            Variable ULY,2,3     ;upper left row value
  1805.            Variable LRX,2,75    ;lower right col value
  1806.            Variable LRY,2,20    ;lower right row value
  1807.            Variable BoxFore,2,4 ;foreground color red
  1808.            Variable BoxBack,2,0 ;background color black
  1809.            Box1     ULX, ULY, LRX, LRY, BoxFore, BoxBack
  1810.            Box1     5,3,75,20,7,0
  1811.            Box1     5,3,75,20,112
  1812.  
  1813.         The first example draws a box whose upper left coordinates are the
  1814.         contents of the variables ULX and ULY and whose lower left coordinates
  1815.         are the contents of the variables LRX and LRY. The box border will be
  1816.         the contents of BoxFore (red) on a background of BoxBack (black).  The
  1817.         second example draws a box whose upper left coordinates are 5,3 and
  1818.         whose lower right coordinates are 75,20. The box border is drawn in
  1819.         white on black. The third example draws a box with the same
  1820.         coordinates and uses the composite color attribute of 112 (white on
  1821.         black). See ClearBox command.
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.                                     Page 34
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.                  BOX4 UX, UY, LX, LY, ForeClr [,BackClr] [,ShadowClr]
  1842.  
  1843.         Draw a box (frame) on the screen whose upper left coordinates (X,Y)
  1844.         are UX,UY, and whose lower right coordinates (X,Y) are LX,LY. Draw the
  1845.         box using a line in foreground color ForeClr on background color
  1846.         BackClr. The border line for the box is single line with a transparent
  1847.         shadow. The shadow color is ShadowClr.
  1848.  
  1849.         The interior of the box is cleared to the background color whether
  1850.         specified explicitly by the background color parameter or as a part of
  1851.         the composite color parameter. The cursor is positioned at UX+1, UY+1.
  1852.  
  1853.            Variable ULX,2,5     ;upper left col value
  1854.            Variable ULY,2,3     ;upper left row value
  1855.            Variable LRX,2,75    ;lower right col value
  1856.            Variable LRY,2,20    ;lower right row value
  1857.            Variable BoxFore,2,4 ;foreground color red
  1858.            Variable BoxBack,2,0 ;background color black
  1859.            Variable Shadow,2,8  ;shadow color
  1860.            Box1     ULX,ULY,LRX,LRY,BoxFore,BoxBack,Shadow
  1861.  
  1862.  
  1863.         This example draws a box whose upper left coordinates are the contents
  1864.         of the variables ULX and ULY and whose lower left coordinates are the
  1865.         contents of the variables LRX and LRY. The box border will be the
  1866.         contents of BoxFore (red) on a background of BoxBack (black). The
  1867.         shadow color is the contents of the variable Shadow. See ClearBox
  1868.         command.
  1869.  
  1870.  
  1871.  
  1872.  
  1873.  
  1874.  
  1875.  
  1876.  
  1877.  
  1878.  
  1879.  
  1880.  
  1881.  
  1882.  
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.                                     Page 35
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.                                        BREAKON
  1895.  
  1896.  
  1897.         Provides a capability to exit from a PowerBatch program by pressing the
  1898.         combination of keys (Ctrl - Break) or (Ctrl - C). The default value
  1899.         set at the beginning of any PowerBatch program is BreakON. To keep a
  1900.         user from exiting a running PowerBatch program, execute the BreakOFF
  1901.         command. If sections of the program are to be protected and other
  1902.         sections not protected, surround the sections with pairs of
  1903.         BreakON...BreakOFF commands. See BreakOff command.
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.  
  1929.  
  1930.  
  1931.  
  1932.  
  1933.  
  1934.  
  1935.  
  1936.  
  1937.  
  1938.  
  1939.  
  1940.  
  1941.                                     Page 36
  1942.  
  1943.  
  1944.  
  1945.  
  1946.  
  1947.                                        BREAKOFF
  1948.  
  1949.         Disables the ability to stop a PowerBatch program by pressing the (Ctrl
  1950.         - Break) or (Ctrl - C) key combinations. The default value set at the
  1951.         beginning of any PowerBatch program is BreakON. See BreakOn command.
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.  
  1989.  
  1990.  
  1991.  
  1992.  
  1993.  
  1994.                                     Page 37
  1995.  
  1996.  
  1997.  
  1998.  
  1999.  
  2000.                              CENTER TextToCenter, LineNum
  2001.  
  2002.         TextToCenter is centered on LineNum. If LineNum is omitted, the
  2003.         current line is assumed. If imbedded color commands are present in
  2004.         TextToCenter, they are processed.
  2005.  
  2006.            Variable InpStr,25,"PowerBatch"
  2007.            Variable MenuLine,19,"@004M@007enu Line 1" 
  2008.            Center   "PowerBatch",2
  2009.            Center   InpStr,2
  2010.            Center   MenuLine,14
  2011.  
  2012.         Both of the first two examples will center the text "PowerBatch" on line
  2013.         2. The third example will center the text "Menu Line 1" on line 14.
  2014.         The value of the variable MenuLine contains imbedded colors commands.
  2015.         Note that the character,"@" is used to signify ASCII 001, a non-
  2016.         printable character. Refer to the notes on imbedded color commands.
  2017.  
  2018.  
  2019.  
  2020.  
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.                                     Page 38
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.                                     CHDIR DirName
  2054.  
  2055.         DirName is made to be the current directory. If DirName contains a
  2056.         drive designation (i.e. C:\NEWDIR), a change will be made to the new
  2057.         drive prior to changing to the new directory.
  2058.  
  2059.            Variable Drive,3
  2060.            Variable Directory,79
  2061.            Write 'Enter new drive letter >'
  2062.            ReadKey  Drive
  2063.            Concat   Drive,':\'
  2064.            Write 'Enter new directory >'
  2065.            ReadStr  Directory
  2066.            Concat   Directory,Drive,Directory
  2067.            ChDir Directory
  2068.  
  2069.         The user is asked to enter a new drive and a new directory. These are
  2070.         then concatenated into the variable Directory. If the resulting value
  2071.         in Directory is "C:\NEWDIR", the ChDir command will change the logged
  2072.         (current default) drive to "C" and the logged directory to "\NEWDIR".
  2073.  
  2074.  
  2075.  
  2076.  
  2077.  
  2078.  
  2079.  
  2080.  
  2081.  
  2082.  
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089.  
  2090.  
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.                                     Page 39
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.                  CLEAR FGrndClr, [,BGrndClr] [,ClearChar] [BorderClr]
  2107.  
  2108.         The current defined screen will be cleared. This may have been altered
  2109.         with a Window command, if so, only the defined window will be cleared.
  2110.         The screen will be cleared to FGrndClr, BGrndClr. If ClearChar is
  2111.         specified, the screen will be cleared to this character, else it will
  2112.         be cleared to spaces. If the current defined screen is 1,1,80,25; the
  2113.         border will be set to BorderClr. The border may be "cleared" to normal
  2114.         with a clear command with BorderClr set to black.
  2115.  
  2116.            Variable ColorAttr,3,112 ;define wht on black
  2117.            Clear ColorAttr      ;clear to composite color 112
  2118.            Clear 7,0,'░'     ;clear to white on black using               
  2119.            ; the char ░ to create a
  2120.                           ; pattern
  2121.            Clear 4,0,,4      ;clear to red on black with
  2122.                           ; red border, no pattern
  2123.  
  2124.  
  2125.  
  2126.  
  2127.  
  2128.  
  2129.  
  2130.  
  2131.  
  2132.  
  2133.  
  2134.  
  2135.  
  2136.  
  2137.  
  2138.  
  2139.  
  2140.  
  2141.  
  2142.  
  2143.  
  2144.  
  2145.  
  2146.  
  2147.  
  2148.  
  2149.  
  2150.  
  2151.  
  2152.  
  2153.                                     Page 40
  2154.  
  2155.  
  2156.  
  2157.  
  2158.  
  2159.                   CLEARBOX UX,XY,LX,LY, FgClr, [BkgClr] [,ClearChar]
  2160.  
  2161.  
  2162.         Clear the interior of the box whose upper left coordinates (X,Y) are
  2163.         UX,UY and whose lower right coordinates (X,Y) are LX,LY. Clear the
  2164.         interior of the box to foreground color FgClr and background color
  2165.         BkgClr. This command clears the "inside" of the box, not the lines
  2166.         which describe the box. If ClearChar is specified, the interior of the
  2167.         box is propagated with the clear character.
  2168.  
  2169.            Variable ULX,2,5     ;upper left col value
  2170.            Variable ULY,2,3     ;upper left row value
  2171.            Variable LRX,2,75    ;lower right col value
  2172.            Variable LRY,2,20    ;lower right row value
  2173.            Variable BoxFore,2,4 ;foreground color red
  2174.            Variable BoxBack,2,0 ;background color black
  2175.            Box1     ULX, ULY, LRX, LRY, BoxFore, BoxBack
  2176.            ClearBox 5,3,75,20,112
  2177.  
  2178.         In this example we define the upper right and lower left coordinates
  2179.         of the box as well as the colors BoxFore and BoxBack. We draw the box
  2180.         with a red line on a black background. The ClearBox command clears the
  2181.         interior of the box to white on black.
  2182.  
  2183.            ClearBox ULX,ULY,LRX,LRY,BoxFore,BoxBack,'▓'
  2184.  
  2185.         This command clears the box to red on black and completely fills the
  2186.         box with the character "▓".
  2187.  
  2188.  
  2189.  
  2190.  
  2191.  
  2192.  
  2193.  
  2194.  
  2195.  
  2196.  
  2197.  
  2198.  
  2199.  
  2200.  
  2201.  
  2202.  
  2203.  
  2204.  
  2205.  
  2206.                                     Page 41
  2207.  
  2208.  
  2209.  
  2210.  
  2211.  
  2212.                     CLEARLINE LineNum, ForeGrndClr [,BackGrndClr]
  2213.  
  2214.         Clear the line number specified by LineNum to a foreground color of
  2215.         ForeGrndClr and a background color of BackGrndClr. The line number is
  2216.         relative to the top of the current window. If you have defined a
  2217.         window with one of the PowerBatch window commands, the ClearLine command
  2218.         will be relative to the top left of this current window.
  2219.  
  2220.            Variable    Red,1,4
  2221.            Variable    Blue,1,1
  2222.            Variable    RedOnBlue,2,20
  2223.            Variable    CurrLine,2,12
  2224.            ClearLine      12,Red,Blue
  2225.            ClearLine      CurrLine,RedOnBlue
  2226.  
  2227.         Both examples of the ClearLine command clear line 12 on the screen to
  2228.         red foreground color and blue background color.
  2229.  
  2230.            Window1     20,5,60,10,32
  2231.            ClearLine      3,26
  2232.  
  2233.         This command will clear the third line of the defined window (the
  2234.         eighth absolute line on the physical screen), i.e. the third line down
  2235.         from the top of the window.
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.  
  2253.  
  2254.  
  2255.  
  2256.  
  2257.  
  2258.  
  2259.                                     Page 42
  2260.  
  2261.  
  2262.  
  2263.  
  2264.  
  2265.                          COLOR ForeGroundClr [,BackgroundClr]
  2266.  
  2267.         Set the default system color to a foreground color of ForeGroundClr
  2268.         and to a background color of BackgroundClr or optionally set the
  2269.         system color to the composite color attribute ForeGroundClr.
  2270.  
  2271.            Variable RedOnBlue,2,20
  2272.            Color 4,1
  2273.            Color MenuClr
  2274.  
  2275.         Both examples set the default color to red on blue for any text
  2276.         written to the screen without specific color instructions.
  2277.  
  2278.  
  2279.  
  2280.  
  2281.  
  2282.  
  2283.  
  2284.  
  2285.  
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.                                     Page 43
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.                      COMPARE Value1, Value2, 1GR2,  1Less2, 1EQ2
  2319.  
  2320.         Compare the contents of Value1 to the contents of Value2. If Value1 is
  2321.         greater than Value2 jump to the Label 1GR2. If Value1 is less than
  2322.         Value2 jump to the label 1Less2. If Value1 is equal Value2 jump to the
  2323.         label 1EQ2. If the contents of the first two operands (Value1, Value2)
  2324.         are numeric then a numeric compare is performed otherwise an
  2325.         alphabetic compare is made. (If 19 is compared alphabetically to 2,
  2326.         then 2 is greater than 19; if it is compared numerically, 19 is
  2327.         greater than 2.)
  2328.  
  2329.            Variable InChar,1
  2330.            Variable Yes,1,"Y"
  2331.            Variable No,1,"N"
  2332.            GoToXY   4,23
  2333.            ReadYN   "Incorrect entry...Continue [Y/N] ",InChar
  2334.            Compare  InChar,"Y",NoIn,NoIn,YesIn
  2335.            Compare  InChar,Yes,,,YesIn   (Not Y falls through)
  2336.            Compare  InChar,"Y",NoIn,NoIn (Y falls through)
  2337.  
  2338.         In the first example, variable InChar is compared to literal "Y". If
  2339.         InChar is greater than "Y" then the program will jump to the label
  2340.         NoIn; if InChar is less than "Y", the program also jumps to the label
  2341.         NoIn; if InChar is equal to "Y", the program will continue processing
  2342.         at the label named YesIn. In the second compare, the variable InChar
  2343.         is compared to the variable Yes which has an assigned value of "Y". If
  2344.         InChar contains anything but "Y", the program continues with the next
  2345.         instruction after the compare command (it is said to fall through); if
  2346.         InChar contains "Y", the program will jump to the label YesIn. In the
  2347.         third compare command, variable InChar is compared to the literal "Y".
  2348.         If the variable InChar contains "N" (ReadYN prevents any entry but Y
  2349.         or N) the program jumps to the label NoIn otherwise it continues with
  2350.         the instruction after the compare command.
  2351.  
  2352.  
  2353.  
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.                                     Page 44
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.                           CONCAT Target, String1 [,String2]
  2372.  
  2373.         If String2 is omitted, String1 is appended to Target. If String2 is
  2374.         present, String2 is appended to String1 and the result replaces
  2375.         Target.
  2376.  
  2377.            Variable    OutMsg,78
  2378.            Variable    ErrMsg," is not a valid Drive letter."
  2379.            Variable    DriveLtr,1
  2380.            WriteAt     6,17,"Enter your source drive letter "
  2381.            ReadUpKey      DriveLtr
  2382.            ?DriveExist DriveLtr,DriveOK
  2383.            Concat      OutMsg, "[19] ", DriveLtr
  2384.            Concat      OutMsg, " is not a valid Drive letter."
  2385.            WriteAt     5,23,OutMsg
  2386.  
  2387.         In this example we ask the user to input a valid drive letter and
  2388.         verify this drive with the ?DriveExist command. If the drive is not
  2389.         valid we concatenate "[19]" (the error number) plus the drive letter
  2390.         entered by the user into the variable OutMsg. We then concatenate the
  2391.         error message (" is not a valid Drive letter.") onto the contents of
  2392.         OutMsg. The result would be something like "[19] L is not a valid
  2393.         Drive letter."
  2394.  
  2395.  
  2396.  
  2397.  
  2398.  
  2399.  
  2400.  
  2401.  
  2402.  
  2403.  
  2404.  
  2405.  
  2406.  
  2407.  
  2408.  
  2409.  
  2410.  
  2411.  
  2412.  
  2413.  
  2414.  
  2415.  
  2416.  
  2417.  
  2418.                                     Page 45
  2419.  
  2420.  
  2421.  
  2422.  
  2423.  
  2424.                                   CURSOR CursorType
  2425.  
  2426.         CursorType may be 1,2, 3 or 4. 1 = normal cursor; 2 = cursor off; 3 =
  2427.         fat cursor; 4 = block cursor. A "fat" cursor is the cursor shape
  2428.         normally seen when text is to be inserted. The block cursor fills the
  2429.         entire screen position. Remember to set the cursor back to normal at
  2430.         the end of a program if you have set the cursor off during the
  2431.         processing of your program. This is not automatically set back to
  2432.         normal when the program terminates.
  2433.  
  2434.            Variable Normal,1,1
  2435.            Variable Off,1,2
  2436.            Variable Fat,1,3
  2437.            Variable Block,1,4
  2438.  
  2439.            Cursor   Off
  2440.            Cursor   2
  2441.            Cursor   Fat,1
  2442.            Cursor   3
  2443.            Cursor   Block
  2444.            Cursor   4
  2445.            Cursor   Normal
  2446.            Cursor   1
  2447.  
  2448.         Each preceding pair of commands will have the same results. Off has a
  2449.         value of 2, Fat has a value of 3, etc.
  2450.  
  2451.  
  2452.  
  2453.  
  2454.  
  2455.  
  2456.  
  2457.  
  2458.  
  2459.  
  2460.  
  2461.  
  2462.  
  2463.  
  2464.  
  2465.  
  2466.  
  2467.  
  2468.  
  2469.  
  2470.  
  2471.                                     Page 46
  2472.  
  2473.  
  2474.  
  2475.  
  2476.  
  2477.                     DIVIDE Result, Divisor [,RtnCode] [,Decimals]
  2478.  
  2479.         If the divisor is less than 1 then Result is set to zero. Result is
  2480.         divided by Divisor and the result  of the division is placed in
  2481.         Result. If the division operation contained no errors, RtnCode will
  2482.         contain zero (0). The number of decimal places in the Result is
  2483.         specified in Decimals. If Decimals is not specified, zero decimal
  2484.         places will be assumed and integer arithmatic will be performed. Your
  2485.         result will be rounded to the number of specified decimal places.
  2486.         Accurate to 18 significant digits.
  2487.  
  2488.            Variable Result,18
  2489.            Variable RtnCode,1
  2490.  
  2491.            SetVar   Result,15
  2492.            Divide   Result,3    (Result now contains 5)
  2493.  
  2494.            SetVar   Result,'.000124'
  2495.            Divide   Result,'.00515',RtnCode,10
  2496.                     (Result contains 0.0240776699)
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516.  
  2517.  
  2518.  
  2519.  
  2520.  
  2521.  
  2522.  
  2523.  
  2524.                                     Page 47
  2525.  
  2526.  
  2527.  
  2528.  
  2529.  
  2530.                                  ENHANCLR Mode
  2531.  
  2532.         The enhanced color command assigns new background colors to the color
  2533.         values above 127 (the blinking colors). The new colors have a
  2534.         background color which is identical to the foreground colors. Run the
  2535.         new COLORS utility to view the new color values.  Mode is either 0
  2536.         (off); or 1 (on). Enhanced colors may be switched on or off at any
  2537.         time and the current screen will be changed.
  2538.  
  2539.            Variable    On,1,1
  2540.            Variable    Off,1,0
  2541.  
  2542.  
  2543.            EnhanClr    On
  2544.  
  2545.  
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.                                     Page 48
  2578.  
  2579.  
  2580.  
  2581.  
  2582.  
  2583.                                        FLUSHKEY
  2584.  
  2585.         Removes all characters from the system keyboard buffer. After
  2586.         execution of this command, there will be no more characters waiting to
  2587.         be retrieved from the keyboard buffer. Use this command to eliminate
  2588.         the possibility of any "type ahead" characters being present in the
  2589.         buffer when you ask for input from the user.
  2590.  
  2591.            WriteLine   'CAUTION, You will now format your hard disk'
  2592.            FlushKey
  2593.            ReadYN   'Format hard Disk (Y/N)? ',InputChar
  2594.  
  2595.  
  2596.  
  2597.  
  2598.  
  2599.  
  2600.  
  2601.  
  2602.  
  2603.  
  2604.  
  2605.  
  2606.  
  2607.  
  2608.  
  2609.  
  2610.  
  2611.  
  2612.  
  2613.  
  2614.  
  2615.  
  2616.  
  2617.  
  2618.  
  2619.  
  2620.  
  2621.  
  2622.  
  2623.  
  2624.  
  2625.  
  2626.  
  2627.  
  2628.  
  2629.                                     Page 49
  2630.  
  2631.  
  2632.  
  2633.  
  2634.  
  2635.                                      GOTO Label1
  2636.  
  2637.         Jump to the statement identified as command label Label1. Program
  2638.         processing will go directly from this GoTo command to Label1 and
  2639.         continue with the command immediately following the label (since the
  2640.         label command is simply a placemarker).
  2641.  
  2642.            GoTo     Error
  2643.            GoTo  EndOfPgm
  2644.  
  2645.  
  2646.  
  2647.  
  2648.  
  2649.  
  2650.  
  2651.  
  2652.  
  2653.  
  2654.  
  2655.  
  2656.  
  2657.  
  2658.  
  2659.  
  2660.  
  2661.  
  2662.  
  2663.  
  2664.  
  2665.  
  2666.  
  2667.  
  2668.  
  2669.  
  2670.  
  2671.  
  2672.  
  2673.  
  2674.  
  2675.  
  2676.  
  2677.  
  2678.  
  2679.  
  2680.  
  2681.  
  2682.                                     Page 50
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.                                GOTOXY XCo-ord, YCo-ord
  2689.  
  2690.         Move the cursor to the column (X) specified in XCo-ord and row (Y)
  2691.         specified in YCo-ord.
  2692.  
  2693.            Variable CurrX,2
  2694.            Variable CurrY,2
  2695.            GoToXY   CurrX, CurrY
  2696.            GoToXY   12,6
  2697.  
  2698.         In the first example the cursor is moved to the location specified by
  2699.         the contents of variable CurrX and CurrY. In the second example, the
  2700.         cursor is moved to the location specified by two literals "12" and
  2701.         "6".
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710.  
  2711.  
  2712.  
  2713.  
  2714.  
  2715.  
  2716.  
  2717.  
  2718.  
  2719.  
  2720.  
  2721.  
  2722.  
  2723.  
  2724.  
  2725.  
  2726.  
  2727.  
  2728.  
  2729.  
  2730.  
  2731.  
  2732.  
  2733.  
  2734.  
  2735.                                     Page 51
  2736.  
  2737.  
  2738.  
  2739.  
  2740.  
  2741.                                   HALT [ErrorLevel]
  2742.  
  2743.         Halt your PowerBatch program and set DOS errorlevel to ErrorLevel.
  2744.  
  2745.            Variable Error14,2,14   ;define Error14 as "14"
  2746.            Halt     99
  2747.            Halt     Error14
  2748.  
  2749.         In the first usage of the Halt command, the PowerBatch program is halted
  2750.         and the DOS errorlevel is set to 99. In the second usage the program
  2751.         is halted and the DOS errorlevel is set to the contents of variable
  2752.         Error14 ("14").
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.  
  2780.  
  2781.  
  2782.  
  2783.  
  2784.  
  2785.  
  2786.  
  2787.  
  2788.                                     Page 52
  2789.  
  2790.  
  2791.  
  2792.  
  2793.  
  2794.                                    LABEL LabelName
  2795.  
  2796.         Define a location in your source that will enable execution to begin
  2797.         immediately following the Label command without necessarily having
  2798.         executed the command immediately prior to the label. Jump immediately
  2799.         to this location in the command stream. See the discussion on labels
  2800.         at the beginning of this section.
  2801.  
  2802.            Label    MatchErr
  2803.            Label    EndOfPgm
  2804.  
  2805.  
  2806.  
  2807.  
  2808.  
  2809.  
  2810.  
  2811.  
  2812.  
  2813.  
  2814.  
  2815.  
  2816.  
  2817.  
  2818.  
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.                                     Page 53
  2842.  
  2843.  
  2844.  
  2845.  
  2846.  
  2847.            LOCSTR  StrToLookFor, StrToLookIn, [Occur] ,Loc [,Replace]
  2848.  
  2849.         Examine the string StrToLookIn for the string StrToLookFor. If Occur
  2850.         does not exist set Occur to 1. Look for the Occur occurrance of the
  2851.         string. If StrToLookFor is found, place the location of the first
  2852.         position of the string in Loc; if StrToLookFor is not found, place
  2853.         zero (0) in Loc. If Replace is present, replace StrToLookFor with
  2854.         Replace.
  2855.  
  2856.            Variable    StrLoc,3
  2857.            Variable    InPutStr,255,'This is a test string'
  2858.            LocStr      'is',InPutStr,,StrLoc
  2859.         StrLoc will contain 3 ("This" contains 'is'),
  2860.  
  2861.            LocStr      'is',InPutStr,2,StrLoc
  2862.         StrLoc will contain 6.
  2863.  
  2864.            LocStr      'test',InPutStr,,StrLoc,'text'
  2865.         StrLoc will contain 11 and InPutStr will be changed to "This is a text
  2866.         string".
  2867.  
  2868.            LocStr      'test',InPutStr,2,StrLoc,'text'
  2869.         StrLoc will contain 0 and InPutStr will not be changed. There is no
  2870.         second occurrance of "test".
  2871.  
  2872.  
  2873.  
  2874.  
  2875.  
  2876.  
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882.  
  2883.  
  2884.  
  2885.  
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.                                     Page 54
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.                              LENGTH StringLength, String
  2901.  
  2902.         Calculate the length of the string in variable String and place the
  2903.         result in StringLength.
  2904.  
  2905.            Variable InString
  2906.            Variable StrLen
  2907.  
  2908.            WriteAt  12,14,"Enter your current directory "
  2909.            ReadStr  InString
  2910.  
  2911.         User enters c:\util.
  2912.  
  2913.            Length   StrLen, InString
  2914.  
  2915.         StrLen will contain 7, the length of "c:\util".
  2916.  
  2917.  
  2918.  
  2919.  
  2920.  
  2921.  
  2922.  
  2923.  
  2924.  
  2925.  
  2926.  
  2927.  
  2928.  
  2929.  
  2930.  
  2931.  
  2932.  
  2933.  
  2934.  
  2935.  
  2936.  
  2937.  
  2938.  
  2939.  
  2940.  
  2941.  
  2942.  
  2943.  
  2944.  
  2945.  
  2946.  
  2947.                                     Page 55
  2948.  
  2949.  
  2950.  
  2951.  
  2952.  
  2953.                                      LOWER String
  2954.  
  2955.         Change the alphabetic characters in the variable String to lower case.
  2956.  
  2957.            Variable InString,25
  2958.            ReadStr  InString
  2959.  
  2960.         User enters C:\UTIL.
  2961.  
  2962.            Lower InString
  2963.  
  2964.         Now contains c:\util.
  2965.  
  2966.  
  2967.  
  2968.  
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974.  
  2975.  
  2976.  
  2977.  
  2978.  
  2979.  
  2980.  
  2981.  
  2982.  
  2983.  
  2984.  
  2985.  
  2986.  
  2987.  
  2988.  
  2989.  
  2990.  
  2991.  
  2992.  
  2993.  
  2994.  
  2995.  
  2996.  
  2997.  
  2998.  
  2999.  
  3000.                                     Page 56
  3001.  
  3002.  
  3003.  
  3004.  
  3005.  
  3006.                     MIDSTRING NewString, OldString, Offset, Length
  3007.  
  3008.         Create a NewString by extracting characters from OldString. Beginning
  3009.         with the Offset character of OldString, extract Length characters and
  3010.         create the new string.
  3011.  
  3012.            Variable Path,79
  3013.            WriteAt  1,2,"Enter Drive and Directory name "
  3014.            ReadStr  Path
  3015.  
  3016.         User enters C:\UTIL.
  3017.  
  3018.            MidString   Drive,Path,1,2
  3019.  
  3020.         Extract C: from C:\UTIL, making the newstring C:.
  3021.  
  3022.  
  3023.  
  3024.  
  3025.  
  3026.  
  3027.  
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.  
  3034.  
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.  
  3044.  
  3045.  
  3046.  
  3047.  
  3048.  
  3049.  
  3050.  
  3051.  
  3052.  
  3053.                                     Page 57
  3054.  
  3055.  
  3056.  
  3057.  
  3058.  
  3059.                     MULTIPLY Result, Number [,RtnCode] [,Decimals]
  3060.  
  3061.         Result is multiplied by Number and the result of the multiplication is
  3062.         placed in Result. If the Multiply operation completed without error,
  3063.         RtnCode will contain zero (0). The number of decimal places in the
  3064.         result is specified in Decimals. If Decimals is not specified, zero
  3065.         decimal places will be assumed and integer arithmatic will be
  3066.         performed. Your Result will be rounded to the number of decimal places
  3067.         specified.
  3068.  
  3069.            Variable Total,14
  3070.            Variable TaxRate,6,'.06875'
  3071.            Variable Tax,8
  3072.            Variable Units,4
  3073.            Variable Quantity,3
  3074.  
  3075.            SetVar   Total,Units          (124)
  3076.            Multiply Total,Quantity          (372)
  3077.            Write 'Your total quantity is '
  3078.            WriteLine   Total
  3079.            Multiply Total,Cost,RtnCode,2    (948.6)
  3080.            SetVar   Tax,Total               (948.6)
  3081.            Multiply Tax,TaxRate,RtnCode,2      (65.22)
  3082.  
  3083.  
  3084.  
  3085.  
  3086.  
  3087.  
  3088.  
  3089.  
  3090.  
  3091.  
  3092.  
  3093.  
  3094.  
  3095.  
  3096.  
  3097.  
  3098.  
  3099.  
  3100.  
  3101.  
  3102.  
  3103.  
  3104.  
  3105.  
  3106.                                     Page 58
  3107.  
  3108.  
  3109.  
  3110.  
  3111.  
  3112.                                         NORMAL
  3113.  
  3114.         Change the current color attribute(s) back to the definition prior to
  3115.         the execution of a BLINK or REVERSE command.
  3116.  
  3117.            Color 20    ;set default color to red on blue
  3118.            Blink       ;changes to blinking red on blue
  3119.            WriteAt  2,24,"Incorrect...re-enter!"
  3120.            Normal         ;resets color to 20
  3121.            Beep     800,8
  3122.            Wait     35    ;pause 3.5 seconds
  3123.            WriteAt  2,24,"                    "   ;clear msg
  3124.  
  3125.         This is an example of a typical error routine. The color attribute is
  3126.         changed to blinking with the Blink command. The error message is
  3127.         written and the color attribute is changed back to its original value
  3128.         with the Normal command. The speaker is "beeped" and after a wait of
  3129.         3.5 seconds, the error message is removed from the screen.
  3130.  
  3131.  
  3132.  
  3133.  
  3134.  
  3135.  
  3136.  
  3137.  
  3138.  
  3139.  
  3140.  
  3141.  
  3142.  
  3143.  
  3144.  
  3145.  
  3146.  
  3147.  
  3148.  
  3149.  
  3150.  
  3151.  
  3152.  
  3153.  
  3154.  
  3155.  
  3156.  
  3157.  
  3158.  
  3159.                                     Page 59
  3160.  
  3161.  
  3162.  
  3163.  
  3164.  
  3165.                     PRINT PrinterNumber, StringToPrint [,RtnCode]
  3166.  
  3167.  
  3168.         PrinterNumber is 1,2, or 3; this corresponds to LPT1, LPT2, and LPT3.
  3169.         The Print command will send the StringToPrint to the printer and WILL
  3170.         NOT append a carriage return/line feed. This allows you to build your
  3171.         print line with a series of Print statements and complete the line
  3172.         with a PrintLine statement to force a CR/LF. While RtnCode is not
  3173.         required, it is highly recommended. If RtnCode contains zero (0), your
  3174.         print operation was successful. If it is not zero, your print
  3175.         operation was not successful. The error code returned varies with the
  3176.         make of printer, but the following seem to be somewhat universal.
  3177.  
  3178.         RtnCode = 8.   Printer not in ready state (printer off line).
  3179.         RtnCode = 40.  Printer out of paper.
  3180.         RtnCode = 48.  Printer not connected or power not on.
  3181.  
  3182.            Variable    PrtLine,80
  3183.            Variable    RtnCode,3
  3184.            Variable    PrtError,,'Printer Error!!Check your printer'
  3185.  
  3186.            SetVar      PrtLine,''
  3187.            Print    1,PrtLine,RtnCode
  3188.            Compare     RtnCode,0,,,PrtReady
  3189.            Write    PrtError
  3190.            ReadKey     InKey
  3191.            Label PrtReady
  3192.            SetVar      PrtLine,InData
  3193.            Print    1,PrtLine,RtnCode
  3194.            Compare     RtnCode,0,,,NextLine
  3195.  
  3196.  
  3197.  
  3198.  
  3199.  
  3200.  
  3201.  
  3202.  
  3203.  
  3204.  
  3205.  
  3206.  
  3207.  
  3208.  
  3209.  
  3210.  
  3211.  
  3212.                                          Page 60
  3213.  
  3214.  
  3215.  
  3216.  
  3217.  
  3218.                   PRINTLINE PrinterNumber, StringToPrint [,RtnCode]
  3219.  
  3220.         PrinterNumber is 1,2, or 3; this corresponds to LPT1, LPT2, and LPT3.
  3221.         The PrintLine command will send the StringToPrint to the printer and
  3222.         WILL append a carriage return/line feed. While RtnCode is not
  3223.         required, it is highly recommended. If RtnCode contains zero (0), your
  3224.         print operation was successful. If it is not zero, your print
  3225.         operation was not successful. The error code returned varies with the
  3226.         make of printer, but the following seem to be somewhat universal.
  3227.  
  3228.         RtnCode = 8.   Printer not in ready state (printer off line).
  3229.         RtnCode = 40.  Printer out of paper.
  3230.         RtnCode = 48.  Printer not connected or power not on.
  3231.  
  3232.            Variable    PrtLine,80
  3233.            Variable    RtnCode,3
  3234.            Variable    PrtError,,'Printer Error!!Check your printer'
  3235.  
  3236.            SetVar      PrtLine,''
  3237.            Print    1,PrtLine,RtnCode    ;is the printer rdy?
  3238.            Compare     RtnCode,0,,,PrtReady
  3239.            Write    PrtError
  3240.            ReadKey     InKey
  3241.            Label PrtReady
  3242.            SetVar      PrtLine,InData
  3243.            PrintLine      1,PrtLine,RtnCode
  3244.            Compare     RtnCode,0,,,NextLine
  3245.  
  3246.  
  3247.  
  3248.  
  3249.  
  3250.  
  3251.  
  3252.  
  3253.  
  3254.  
  3255.  
  3256.  
  3257.  
  3258.  
  3259.  
  3260.  
  3261.  
  3262.  
  3263.  
  3264.  
  3265.                                     Page 61
  3266.  
  3267.  
  3268.  
  3269.  
  3270.  
  3271.                                        PRINTSCR
  3272.  
  3273.         The entire contents of the current screen is sent to the system
  3274.         printer. A page eject is automatically appended to the last character
  3275.         to cause the printer to eject the printed page.
  3276.  
  3277.  
  3278.  
  3279.  
  3280.  
  3281.  
  3282.  
  3283.  
  3284.  
  3285.  
  3286.  
  3287.  
  3288.  
  3289.  
  3290.  
  3291.  
  3292.  
  3293.  
  3294.  
  3295.  
  3296.  
  3297.  
  3298.  
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304.  
  3305.  
  3306.  
  3307.  
  3308.  
  3309.  
  3310.  
  3311.  
  3312.  
  3313.  
  3314.  
  3315.  
  3316.  
  3317.  
  3318.                                     Page 62
  3319.  
  3320.  
  3321.  
  3322.  
  3323.  
  3324.                                  PROMPT NewPromptVal
  3325.  
  3326.         Change the current value of the prompt to the value specified in
  3327.         NewPromptVal.
  3328.  
  3329.            Prompt   "$P$G"
  3330.  
  3331.  
  3332.  
  3333.  
  3334.  
  3335.  
  3336.  
  3337.  
  3338.  
  3339.  
  3340.  
  3341.  
  3342.  
  3343.  
  3344.  
  3345.  
  3346.  
  3347.  
  3348.  
  3349.  
  3350.  
  3351.  
  3352.  
  3353.  
  3354.  
  3355.  
  3356.  
  3357.  
  3358.  
  3359.  
  3360.  
  3361.  
  3362.  
  3363.  
  3364.  
  3365.  
  3366.  
  3367.  
  3368.  
  3369.  
  3370.  
  3371.                                     Page 63
  3372.  
  3373.  
  3374.  
  3375.  
  3376.  
  3377.                               RANDOM UpperLimit, Result
  3378.  
  3379.         A random number is generated from (and including) zero through the
  3380.         UpperLimit. The random number is placed in Result.
  3381.  
  3382.            Variable RandNum,3
  3383.  
  3384.            Random   200,RandNum
  3385.  
  3386.         A random number between 0 and 200 inclusive will be generated.
  3387.  
  3388.            Label NewNumb
  3389.            Random   200,RandNum
  3390.            Compare  RandNum,100,,NewNumb
  3391.  
  3392.         This will generate a random number between 100 and 200.
  3393.  
  3394.  
  3395.  
  3396.  
  3397.  
  3398.  
  3399.  
  3400.  
  3401.  
  3402.  
  3403.  
  3404.  
  3405.  
  3406.  
  3407.  
  3408.  
  3409.  
  3410.  
  3411.  
  3412.  
  3413.  
  3414.  
  3415.  
  3416.  
  3417.  
  3418.  
  3419.  
  3420.  
  3421.  
  3422.  
  3423.  
  3424.                                     Page 64
  3425.  
  3426.  
  3427.  
  3428.  
  3429.  
  3430.                READKEY Target [,SpecInd] [,Tmeout] [,NoPrt] [,CtlChar]
  3431.  
  3432.         Read a single key from the keyboard and place the result in Target. If
  3433.         SpecInd contains a "1" after reading the key from the keyboard, then a
  3434.         "special key" has been returned in Target. Special keys are function
  3435.         keys, Page Up/Down, cursor movement keys, etc. If you are in doubt
  3436.         about a particular key, run the program "KEYID" (furnished on the
  3437.         install disk). Each key you press will be identified as either a
  3438.         regular key or a special key and the value that will be returned in
  3439.         Target when this key is pressed (remember that SpecInd will contain a
  3440.         "1" for special keys).
  3441.  
  3442.          The TmeOut parameter is used when you want to wait for a key from the
  3443.         keyboard, but continue processing without receiving the key after a
  3444.         specified number of seconds. Placing the number of seconds to wait in
  3445.         TmeOut will allow your program to "fall through" the ReadKey
  3446.         instruction if the timeout value is exceeded. If no input is received
  3447.         within TmeOut seconds, the null character (ASCII 0) is placed in
  3448.         Target and zero is placed in SpecInd.
  3449.  
  3450.         The NoPrt parameter gives you the option to have the entered character
  3451.         printed or not. The default is to print the character. If you wish to
  3452.         have the character not printed to the screen, place a one (1) in the
  3453.         NoPrt parameter.
  3454.  
  3455.         ReadKey gives you the capability to check for Non-ASCII keys (i.e.
  3456.         NumLock, Scroll Lock, etc.). Place one of the characters from the
  3457.         following table in the CtlChar parameter. If the requested key is
  3458.         pressed on the keyboard (or toggled on in the case of NumLock, Scroll
  3459.         Lock, and Caps Lock), ReadKey will return with SpecInd set to 2. No
  3460.         key will be returned in Target. Select one of these values to be
  3461.         placed in CtlChar:
  3462.            Right Shift #1    Left Shift     #2
  3463.            Ctrl        #4    Alt         #8
  3464.            Scroll Lock #16      Num Lock #32
  3465.            Caps Lock   #64      Insert      #128
  3466.  
  3467.  
  3468.  
  3469.  
  3470.  
  3471.  
  3472.  
  3473.  
  3474.  
  3475.  
  3476.  
  3477.                                     Page 65
  3478.  
  3479.  
  3480.  
  3481.  
  3482.  
  3483.                            Variable InKey,1
  3484.            Variable Spec,1
  3485.            Variable F10,1,#68
  3486.            Variable Caps,1,#64
  3487.  
  3488.            ReadKey  InKey          ;read a single key
  3489.  
  3490.            ReadKey  InKey,Spec
  3491.            Compare  Spec,1,Reg,Reg       ;fall thru if Spec=1
  3492.            Compare  InKey,F10,NotF10,NotF10 ;fall thru if F10
  3493.  
  3494.            ReadKey  InKey,Spec,10        ;wait 10 secs 
  3495.            Compare  InKey,'',,,NoKey     ;InKey=null, timedout
  3496.  
  3497.            ReadKey  InKey,,,1            ;dont print the input
  3498.  
  3499.            ReadKey  InKey,Spec,,,Caps
  3500.            Compare  Spec,2,,,CapsOn      ;Spec=2, caps lock on
  3501.            Write 'Caps Lock is off'
  3502.  
  3503.  
  3504.  
  3505.  
  3506.  
  3507.  
  3508.  
  3509.  
  3510.  
  3511.  
  3512.  
  3513.  
  3514.  
  3515.  
  3516.  
  3517.  
  3518.  
  3519.  
  3520.  
  3521.  
  3522.  
  3523.  
  3524.  
  3525.  
  3526.  
  3527.  
  3528.  
  3529.  
  3530.                                     Page 66
  3531.  
  3532.  
  3533.  
  3534.  
  3535.  
  3536.                               READSTR Target [,TimeOut]
  3537.  
  3538.         Read a string of characters from the keyboard until the user presses
  3539.         the enter key. Any number of characters may be read up to the maximum
  3540.         length specified for Target in the Variable statement. If the TimeOut
  3541.         parameter is specified, wait the specified number of seconds before
  3542.         continuing without having received a key.
  3543.  
  3544.            Variable InString,12
  3545.            ReadStr  InString    ;12 chars max will be read
  3546.  
  3547.            Label ReadPass
  3548.            ReadStr  InString,10 ;Only wait 10 secs for input
  3549.            Compare  InString,'',InputOK
  3550.            WriteAt  12,24,'Please enter your password'
  3551.            GoTo     ReadPass
  3552.  
  3553.            Label InputOK
  3554.  
  3555.  
  3556.  
  3557.  
  3558.  
  3559.  
  3560.  
  3561.  
  3562.  
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.  
  3569.  
  3570.  
  3571.  
  3572.  
  3573.  
  3574.  
  3575.  
  3576.  
  3577.  
  3578.  
  3579.  
  3580.  
  3581.  
  3582.  
  3583.                                     Page 67
  3584.  
  3585.  
  3586.  
  3587.  
  3588.  
  3589.                              READUPKEY Target [,TimeOut]
  3590.  
  3591.         Read a single character from the keyboard, changing the case of any
  3592.         alphabetic character to upper case and place this upper case character
  3593.         in Target. If the TimeOut parameter is present, continue with the
  3594.         execution of the program after TimeOut seconds even if no character is
  3595.         entered.
  3596.  
  3597.            ReadUpKey   CharIn   ;read a single char in upper case
  3598.  
  3599.            WriteAt  16,24,'Enter your drive letter'
  3600.            ReadUpKey   CharIn,10      ;wait 10 seconds for a key
  3601.            Compare  CharIn,'',GotDrive,GotDrive
  3602.            SetVar   CharIn,'C'  ;supply default drive letter
  3603.  
  3604.            Label GotDrive
  3605.  
  3606.  
  3607.  
  3608.  
  3609.  
  3610.  
  3611.  
  3612.  
  3613.  
  3614.  
  3615.  
  3616.  
  3617.  
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.  
  3625.  
  3626.  
  3627.  
  3628.  
  3629.  
  3630.  
  3631.  
  3632.  
  3633.  
  3634.  
  3635.  
  3636.                                     Page 68
  3637.  
  3638.  
  3639.  
  3640.  
  3641.  
  3642.                      READYN Message, Target [,TimeOut][,NoPrint]
  3643.  
  3644.         Write the message found in Message at the current cursor location and
  3645.         wait for a single key to be entered from the keyboard. Force the user
  3646.         to enter either a "Y" or "N" and place the upper case "Y" or "N" in
  3647.         Target. If TimeOut is specified, wait only the specified number of
  3648.         seconds before continuing with the program without input. If the
  3649.         character entered is not to be printed, place a one (1) in NoPrint.
  3650.  
  3651.            Variable Msg4,35,"Invalid name...Continue [Y/N] "
  3652.            ReadYN   "Invalid name...Continue [Y/N] ",CharIn
  3653.  
  3654.            ReadYN   Msg4,CharIn
  3655.  
  3656.         In both usages of the ReadYN command, the message "Invalid
  3657.         filename...Continue [Y/N] " will be displayed and the program will
  3658.         wait for a response from the user. If the user enters any characters
  3659.         other than "Y", "y", "N", or "n" the system speaker will sound and the
  3660.         user is prompted again for input. At the completion of this command,
  3661.         the variable CharIn will contain either "Y" or "N" (always upper
  3662.         case).
  3663.  
  3664.            Label ErrMsg
  3665.            ReadYN   Msg4,CharIn,8
  3666.            Compare  CharIn,'',GotChar
  3667.            Beep     800,8
  3668.            GoTo     ErrMsg
  3669.  
  3670.         If the user does not enter a character within 8 seconds, the system
  3671.         speaker will be sounded and the user asked again for input.
  3672.  
  3673.  
  3674.  
  3675.  
  3676.  
  3677.  
  3678.  
  3679.  
  3680.  
  3681.  
  3682.  
  3683.  
  3684.  
  3685.  
  3686.  
  3687.  
  3688.  
  3689.                                     Page 69
  3690.  
  3691.  
  3692.  
  3693.  
  3694.  
  3695.                                        REVERSE
  3696.  
  3697.         Change the text attributes to "reverse video". This is accomplished by
  3698.         swapping the foreground and background attributes. This command is
  3699.         "undone" by using NORMAL.
  3700.  
  3701.            Color 20    ;red on black
  3702.            Reverse        ;color is changed to black on red
  3703.            WriteAt  1,15,"Press Escape To Continue"
  3704.            Normal         ;color is now red on black
  3705.  
  3706.  
  3707.  
  3708.  
  3709.  
  3710.  
  3711.  
  3712.  
  3713.  
  3714.  
  3715.  
  3716.  
  3717.  
  3718.  
  3719.  
  3720.  
  3721.  
  3722.  
  3723.  
  3724.  
  3725.  
  3726.  
  3727.  
  3728.  
  3729.  
  3730.  
  3731.  
  3732.  
  3733.  
  3734.  
  3735.  
  3736.  
  3737.  
  3738.  
  3739.  
  3740.  
  3741.  
  3742.                                     Page 70
  3743.  
  3744.  
  3745.  
  3746.  
  3747.  
  3748.                                      SCRMODE Mode
  3749.  
  3750.         Used for changing the screen mode to 43/50 lines per screen on
  3751.         monitors that have the capability to display in these modes. The mode
  3752.         shift will automatically detect either 43 or 50 lines and change to
  3753.         the proper mode. Mode 0 will switch from 43/50 to 25 lines per screen.
  3754.         Mode 1 will switch from 25 lines to 43/50 lines per screen.
  3755.  
  3756.            Variable 25Lines,1,0 ;define a var with value 0
  3757.            Variable 43Lines,1,1 ;define a var with value 1
  3758.  
  3759.            Mode     43Lines
  3760.            Perform  DisplayParms   ;display a file 
  3761.            Mode     25Lines     ;return to normal screen display
  3762.  
  3763.  
  3764.  
  3765.  
  3766.  
  3767.  
  3768.  
  3769.  
  3770.  
  3771.  
  3772.  
  3773.  
  3774.  
  3775.  
  3776.  
  3777.  
  3778.  
  3779.  
  3780.  
  3781.  
  3782.  
  3783.  
  3784.  
  3785.  
  3786.  
  3787.  
  3788.  
  3789.  
  3790.  
  3791.  
  3792.  
  3793.  
  3794.  
  3795.                                     Page 71
  3796.  
  3797.  
  3798.  
  3799.  
  3800.  
  3801.                            SETENV EnvironName EnvironValue
  3802.  
  3803.         The environment variable named EnvironName will have its value changed
  3804.         to EnvironValue. Error messages will occur if the size of the new
  3805.         value minus the size of the old value is greater than the number of
  3806.         free bytes of environment space available.
  3807.  
  3808.            Variable    VarName,7,"MONITOR"
  3809.            Variable VarValue,5,"color"
  3810.  
  3811.            SetEnv   VarName, VarValue
  3812.            SetEnv   "Monitor","color"
  3813.  
  3814.         Both examples will change the environment variable "Monitor" to have a
  3815.         value of "color".
  3816.  
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.  
  3834.  
  3835.  
  3836.  
  3837.  
  3838.  
  3839.  
  3840.  
  3841.  
  3842.  
  3843.  
  3844.  
  3845.  
  3846.  
  3847.  
  3848.                                     Page 72
  3849.  
  3850.  
  3851.  
  3852.  
  3853.  
  3854.                                    SETPATH NewPath
  3855.  
  3856.         The current PATH environment variable will have its value changed to
  3857.         NewPath. Error messages will occur if the size of the new path value
  3858.         minus the size of the old value is greater than the number of free
  3859.         bytes of environment space available.
  3860.  
  3861.            Variable NewPath,40,"d:\;c:\util\exec;c:\wp\letters"
  3862.  
  3863.            SetPath  NewPath
  3864.            SetPath  "d:\;c:\;"
  3865.  
  3866.  
  3867.  
  3868.  
  3869.  
  3870.  
  3871.  
  3872.  
  3873.  
  3874.  
  3875.  
  3876.  
  3877.  
  3878.  
  3879.  
  3880.  
  3881.  
  3882.  
  3883.  
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.  
  3890.  
  3891.  
  3892.  
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898.  
  3899.  
  3900.  
  3901.                                     Page 73
  3902.  
  3903.  
  3904.  
  3905.  
  3906.  
  3907.                               SETVAR VariableName, Value
  3908.  
  3909.         Set the value of VariableName to the contents of Value. A variable
  3910.         cannot be set to a value greater in length than the  maximum length
  3911.         parameter in the Variable definition.
  3912.  
  3913.            Variable ErrCode,3
  3914.            Variable FileName,79
  3915.  
  3916.            SetVar   ErrCode,99
  3917.            SetVar   FileName,"C:\CONFIG.SYS"
  3918.  
  3919.         In the first usage of the SetVar command, the variable ErrCode is set
  3920.         to "99" and the second usage sets the variable FileName to
  3921.         "C:\CONFIG.SYS".
  3922.  
  3923.  
  3924.  
  3925.  
  3926.  
  3927.  
  3928.  
  3929.  
  3930.  
  3931.  
  3932.  
  3933.  
  3934.  
  3935.  
  3936.  
  3937.  
  3938.  
  3939.  
  3940.  
  3941.  
  3942.  
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949.  
  3950.  
  3951.  
  3952.  
  3953.  
  3954.                                     Page 74
  3955.  
  3956.  
  3957.  
  3958.  
  3959.  
  3960.                     SUBTRACT Total, Number [,RtnCode] [,Decimals]
  3961.  
  3962.         Subtract the contents of Number from the contents of Total and place
  3963.         the result in Total. If the subtract operation completed without
  3964.         error, RtnCode will contain zero (0). The number of decimals in Total
  3965.         is specified in Decimals. If Decimals is not specified, zero decimal
  3966.         places will be assumed and integer arithmatic will be performed. The
  3967.         Total is rounded to the specified number of decimal places.
  3968.  
  3969.            Variable TotalLines,2,25
  3970.            Variable RtnCode,1
  3971.  
  3972.            Subtract TotalLines,1
  3973.            Compare  RtnCode,0,ErrRoutine
  3974.  
  3975.         Subtract the constant "1" from the variable "TotalLines" and place the
  3976.         result in TotalLines.
  3977.  
  3978.         Using decimal arithmatic in PowerBatch...
  3979.  
  3980.            Variable TotAmt,12
  3981.            Variable TaxAmt,10
  3982.  
  3983.            SetVar   TaxAmt,TotAmt
  3984.            Multiply TaxAmt,'.025',RtnCode,3
  3985.            Subtract TotAmt,TaxAmt,RtnCode,2
  3986.  
  3987.  
  3988.  
  3989.  
  3990.  
  3991.  
  3992.  
  3993.  
  3994.  
  3995.  
  3996.  
  3997.  
  3998.  
  3999.  
  4000.  
  4001.  
  4002.  
  4003.  
  4004.  
  4005.  
  4006.  
  4007.                                     Page 75
  4008.  
  4009.  
  4010.  
  4011.  
  4012.  
  4013.                       TRIM  StrToChg [,Indicator] [,CharToTrim]
  4014.  
  4015.         StrToChg is the string to be "trimmed". Indicator is (L)eft, (R)ight,
  4016.         or (B)oth indicating which end of the string is to be trimmed. If
  4017.         Indicator is not specified, (R)ight will be assumed. CharToTrim is the
  4018.         character which will be trimmed from the string. If no CharToTrim is
  4019.         specified, blanks will be trimmed from the string.
  4020.  
  4021.            Variable    InString,80
  4022.  
  4023.            ReadFile    'INPUT',InString
  4024.            Trim        InString
  4025.  
  4026.         If there are any trailing blanks read from the file, the Trim command
  4027.         will eliminate these trailing blanks. (No character was specified and
  4028.         blank was assumed; no indicator was specified and Right was assumed.
  4029.  
  4030.            Variable    Total,11
  4031.            Variable    Left,1,'L'
  4032.            Variable    Zero,1,'0'
  4033.  
  4034.            Trim        Total,Left,Zero
  4035.  
  4036.         Here the Trim command is used to remove leading (left end) zeros from
  4037.         a numeric field.
  4038.  
  4039.  
  4040.  
  4041.  
  4042.  
  4043.  
  4044.  
  4045.  
  4046.  
  4047.  
  4048.  
  4049.  
  4050.  
  4051.  
  4052.  
  4053.  
  4054.  
  4055.  
  4056.  
  4057.  
  4058.  
  4059.  
  4060.                                     Page 76
  4061.  
  4062.  
  4063.  
  4064.  
  4065.  
  4066.                                   UPPER VariableName
  4067.  
  4068.         Change all the alphabetic characters in VariableName to upper case.
  4069.  
  4070.            Variable InString,25
  4071.            WriteAt  14,25,"Enter your directory name "
  4072.            ReadStr  InString       (user enters c:\util)
  4073.            Upper    InString    (changed to C:\UTIL)
  4074.            ?InPath  InString,GoodDir  (path is always upper case)
  4075.  
  4076.         In this example, the user is prompted for a path name to be entered.
  4077.         The path name is to be compared to the system path for validity. Since
  4078.         the contents of the system path are always in upper case, we change
  4079.         the InString variable to upper case prior to comparison.
  4080.  
  4081.  
  4082.  
  4083.  
  4084.  
  4085.  
  4086.  
  4087.  
  4088.  
  4089.  
  4090.  
  4091.  
  4092.  
  4093.  
  4094.  
  4095.  
  4096.  
  4097.  
  4098.  
  4099.  
  4100.  
  4101.  
  4102.  
  4103.  
  4104.  
  4105.  
  4106.  
  4107.  
  4108.  
  4109.  
  4110.  
  4111.  
  4112.  
  4113.                                     Page 77
  4114.  
  4115.  
  4116.  
  4117.  
  4118.  
  4119.                    VARIABLE VariableName, MaxLength [,InitialValue]
  4120.  
  4121.         Define a variable to be used in a PowerBatch program. The variable will
  4122.         have a maximum length of MaxLength and an initial value of
  4123.         InitialValue. The initial value may be either an alphabetic value, a
  4124.         numeric value, or an ASCII value. An initial value which is alphabetic
  4125.         must be enclosed in either single or double quotes. A numeric initial
  4126.         value may be defined with or without quote delimiters but a convention
  4127.         of no quotes is a recommended technique. An  ASCII value is expressed
  4128.         as #nnn where nnn is the decimal value of the ASCII character. A
  4129.         variable may be of any length from 1 through 255. The initial value
  4130.         may be of any length from 1 through the MaxLength. VariableName is the
  4131.         name which you give to this variable and the means by which you refer
  4132.         to the variable in other PowerBatch commands.  See the discussion on
  4133.         variables at the beginning of this section.
  4134.  
  4135.         The special variables CLP%1 - CLP%16 are used to receive Command line
  4136.         parameters passed to a compiled PowerBatch program. Any command line
  4137.         parameters will be found in these  special parameters only.  Any
  4138.         number of parameters up to the max of 16 may be passed.
  4139.  
  4140.         Define a variable with no initial value.
  4141.            Variable DayOfWeek,9
  4142.  
  4143.         Define an alpha variable with an initial value.
  4144.            Variable ErrMsg1,25,"Invalid directory name."
  4145.  
  4146.         Define a variable with an initial numeric value of 50.
  4147.            Variable PauseTime,2,50
  4148.  
  4149.         Define a variable as a single ASCII value.
  4150.            Variable RightArrow,1,#26
  4151.  
  4152.         Define a variable as a string of ASCII values.
  4153.            Variable DblLine,5,#205#205#205#205#205
  4154.  
  4155.         Define a variable to receive a command line parameter.
  4156.            Variable CLP%1,12
  4157.  
  4158.  
  4159.  
  4160.  
  4161.  
  4162.  
  4163.  
  4164.  
  4165.  
  4166.                                     Page 78
  4167.  
  4168.  
  4169.  
  4170.  
  4171.  
  4172.                                 WAIT TimeToWait
  4173.  
  4174.         Cause the execution of a PowerBatch program to pause for a specified
  4175.         amount of time. TimeToWait is expressed in tenths of a second.
  4176.  
  4177.            Variable PauseTime,2,50
  4178.            Wait     5     (pause half a second)
  4179.            Wait     PauseTime   (pause 5 seconds)
  4180.            Wait     35    (pause 3.5 seconds)
  4181.  
  4182.  
  4183.  
  4184.  
  4185.  
  4186.  
  4187.  
  4188.  
  4189.  
  4190.  
  4191.  
  4192.  
  4193.  
  4194.  
  4195.  
  4196.  
  4197.  
  4198.  
  4199.  
  4200.  
  4201.  
  4202.  
  4203.  
  4204.  
  4205.  
  4206.  
  4207.  
  4208.  
  4209.  
  4210.  
  4211.  
  4212.  
  4213.  
  4214.  
  4215.  
  4216.  
  4217.  
  4218.  
  4219.                                     Page 79
  4220.  
  4221.  
  4222.  
  4223.  
  4224.  
  4225.                   WINDOW0-3 UpX,UpY,LoX,LoY,FGClr [,BKClr]
  4226.                   WINDOW4 UpX,UpY,LoX,LoY,FGClr [,BKClr] [,ShadClr]
  4227.  
  4228.         A virtual screen is defined with the boundaries UpX, UpY, LoX, LoY.
  4229.         The color attributes for this new screen are set to FGClr, BKClr. The
  4230.         area enclosed within this new screen is not cleared. Each window type
  4231.         has a different frame drawn around the window.
  4232.  
  4233.            Window0     No frame
  4234.            Window1     Single line
  4235.            Window2     Double line
  4236.            Window3     Heavy line
  4237.            Window4     Single line with shadow
  4238.  
  4239.         The cursor is positioned in the upper left corner of the window
  4240.         (location 1,1 for the new screen). This virtual screen will wrap at
  4241.         the new column boundaries and scroll at the new row boundaries. This
  4242.         screen appears in every way to DOS as the full size of the screen.
  4243.  
  4244.  
  4245.  
  4246.  
  4247.  
  4248.  
  4249.  
  4250.  
  4251.  
  4252.  
  4253.  
  4254.  
  4255.  
  4256.  
  4257.  
  4258.  
  4259.  
  4260.  
  4261.  
  4262.  
  4263.  
  4264.  
  4265.  
  4266.  
  4267.  
  4268.  
  4269.  
  4270.  
  4271.  
  4272.                                     Page 80
  4273.  
  4274.  
  4275.  
  4276.  
  4277.  
  4278.                       WRITE StringToWrite [,ForeClr] [,BackClr]
  4279.  
  4280.         Write the string contained in StringToWrite at the current cursor
  4281.         location using foreground color attribute ForeClr and background color
  4282.         attribute BackClr. In the absence of ForeClr and BackClr use the
  4283.         current color attributes. If the string contains imbedded color
  4284.         attributes, change the colors in the string according to these values.
  4285.         (See Imbedded Color Commands). The string is not followed by a
  4286.         carriage return, line feed pair (i.e. the cursor is not moved to the
  4287.         first position of the next line).
  4288.  
  4289.         Write the string "Enter your password" in black on white.
  4290.            Write "Enter your password ",0,7
  4291.  
  4292.         Write "Invalid directory name" contained in a variable using the
  4293.         composite color 112, also contained in a variable.
  4294.            Variable ErrMsg1,25,"Invalid directory name."
  4295.            Variable ErrClr,3,112
  4296.            Write ErrMsg1,ErrClr
  4297.  
  4298.         Write the string "Menu of choices" with the "M" in Menu written in
  4299.         color 112 and the remainder of the string written in  color 31.
  4300.            Variable MenuTitle,23,'@112M@031enu of choices'
  4301.            Write MenuTitle
  4302.  
  4303.  
  4304.  
  4305.  
  4306.  
  4307.  
  4308.  
  4309.  
  4310.  
  4311.  
  4312.  
  4313.  
  4314.  
  4315.  
  4316.  
  4317.  
  4318.  
  4319.  
  4320.  
  4321.  
  4322.  
  4323.  
  4324.  
  4325.                                     Page 81
  4326.  
  4327.  
  4328.  
  4329.  
  4330.  
  4331.                  WRITEAT XLoc, YLoc, StringVal [,ForeClr] [,BackClr]
  4332.  
  4333.         Write the value contained in StringVal at column location contained in
  4334.         XLoc and at row location contained in YLoc using the foreground color
  4335.         attribute contained in ForeClr and the background color attribute
  4336.         contained in BackClr. In the absence of ForeClr and BackClr, use the
  4337.         current color attributes. The string is not followed by a carriage
  4338.         return, line feed pair (i.e. the cursor is not moved to the first
  4339.         position of the next line).
  4340.  
  4341.            Variable TitleClr,3,112
  4342.            Variable CurrX,2
  4343.            Variable CurrY,2
  4344.            Variable CompName,25,"The ABC Company"
  4345.            WriteAt  15,3,"The ABC Company",TitleClr
  4346.            WriteAt  CurrX,CurrY,CompName
  4347.  
  4348.         In the first usage of the WriteAt command, the literal "The ABC
  4349.         Company" is written at column 15, row 3. In the second usage, the
  4350.         contents of the variable CompName ("The ABC Company") is written at
  4351.         the column location specified by the contents of variable CurrX and at
  4352.         the row location specified by the contents of variable CurrY.
  4353.  
  4354.  
  4355.  
  4356.  
  4357.  
  4358.  
  4359.  
  4360.  
  4361.  
  4362.  
  4363.  
  4364.  
  4365.  
  4366.  
  4367.  
  4368.  
  4369.  
  4370.  
  4371.  
  4372.  
  4373.  
  4374.  
  4375.  
  4376.  
  4377.  
  4378.                                     Page 82
  4379.  
  4380.  
  4381.  
  4382.  
  4383.  
  4384.                         WRITELINE StringToWrite [,LineNumber]
  4385.  
  4386.         Write the string contained in StringToWrite beginning at position 1 of
  4387.         the line number specified in LineNumber. Follow the string with a
  4388.         carriage return line feed pair (i.e. move the cursor to the first
  4389.         position of the next line). In the absence of LineNumber write the
  4390.         string at the current cursor location. Expand any imbedded color
  4391.         commands in the string. (See note below on imbedded color commands).
  4392.  
  4393.            WriteLine "Please read these instructions ",7
  4394.  
  4395.         The message "Please read these instructions " is written beginning in
  4396.         column 1 of row 7. Follow the string with a CR/LF.
  4397.  
  4398.            WriteLine Msg5
  4399.  
  4400.         Write the contents of the variable Msg5 beginning at the current
  4401.         cursor location. Follow the string with a CR/LF.
  4402.  
  4403.            Write "Enter the letter of the selected drive > "
  4404.            ReadKey  InKey
  4405.            WriteLine   ""
  4406.  
  4407.         Write the string "Enter the letter of the selected drive > ", leaving
  4408.         the cursor positioned at the end of this message (the Write command
  4409.         does not supply a CR/LF. After receiving the entry from the user,
  4410.         position the cursor at the beginning of the next line by "writing" to
  4411.         the screen a null string (two quote marks without any character
  4412.         between) using the WriteLine command. This will write to the screen
  4413.         only a CR/LF.
  4414.  
  4415.  
  4416.  
  4417.  
  4418.  
  4419.  
  4420.  
  4421.  
  4422.  
  4423.  
  4424.  
  4425.  
  4426.  
  4427.  
  4428.  
  4429.  
  4430.  
  4431.                                     Page 83
  4432.  
  4433.  
  4434.  
  4435.  
  4436.  
  4437.                                   STANDARD VARIABLES
  4438.  
  4439.         There are several variables which are in every PowerBatch program. These
  4440.         Standard Variables may be referenced without having to define them
  4441.         with a Variable command.
  4442.  
  4443.                 DispAdapter - This 4 character variable will contain a code describing
  4444.            the type of display controller card located in your system. If the
  4445.            first character contains "M", the adapter is a monochrome adapter.
  4446.            If the first character contains "C", the adapter is a color
  4447.            adapter. The remaining 3 characters may contain:
  4448.                  MDA-Monochrome Display Adapter
  4449.                  CGA-Color Graphics Adapter
  4450.                  EGA-Extended Graphics Adapter
  4451.                  VGA-Video Graphics Array
  4452.                  MGA-Multi-color Graphics Array
  4453.               If no video adapter is found the field will contain "NONE".
  4454.  
  4455.                 DOSError - If the external program which you execute sets a DOS error
  4456.            code, the error code will be placed in this variable.
  4457.  
  4458.                 DOSVer - This field will contain a 4 character code for the version of
  4459.            DOS installed. The first two characters are the major version and
  4460.            the last two the minor version. DOS 6.0 will be reported as 0600.
  4461.  
  4462.                 ErrorLevel - If the external program which you execute sets an
  4463.            ErrorLevel and that ErrorLevel is returned to PowerBatch by DOS, it
  4464.            will be placed in this variable.
  4465.  
  4466.                 ParallelPorts - This variable will contain the number of parallel ports
  4467.            supported by your hardware.
  4468.  
  4469.                 SerialPorts - This variable will contain the number of serial ports
  4470.            supported by your hardware.
  4471.  
  4472.  
  4473.  
  4474.  
  4475.  
  4476.  
  4477.  
  4478.  
  4479.  
  4480.  
  4481.  
  4482.  
  4483.  
  4484.                                     Page 84
  4485.  
  4486.  
  4487.  
  4488.  
  4489.  
  4490.                                 Command Summary
  4491.  
  4492.         ?Color      Foreground Background Composite
  4493.         ?CurrDir    CurrDrive CurrDirectory
  4494.         ?Date       DayOfWeek Month Day Year
  4495.         ?DirExist   DirName FoundLbl [NotFoundLbl]
  4496.         ?DiskInfo   DriveLetter VolID DriveType
  4497.         ?DiskSpace  DriveLetter TotalSpace FreeSpace
  4498.         ?DriveExist DriveLetter ValidLabel [InvalidLabel]
  4499.         ?EnvStr     EnvironName EnvironNameContents
  4500.         ?FileExist  FileName FoundLabel [NotFoundLabel]
  4501.         ?FileExpan  FileName FoundLabel [NotFoundLabel]
  4502.         ?FileSize   FileSize FileName
  4503.         ?Inpath     DirName FoundLabel [NotFoundLabel]
  4504.         ?Time       CurrentTime
  4505.         Add         Sum Number [RtnCode] [Decimals]
  4506.         Beep        Frequency Duration [Repeat]
  4507.         Blink
  4508.         Boot
  4509.         Box0-3      Ux Uy Lx Ly ForeClr [BackClr]
  4510.         Box4        Ux Uy Lx Ly ForeClr [BackClr] [ShadowClr]
  4511.         BreakOn
  4512.         BreakOff
  4513.         Center      TextToCenter LineNum
  4514.         ChDir       DirName
  4515.         Clear       FgrndClr [BgrndClr] [ClearChar] [BorderClr]
  4516.         ClearBox    Ux Uy Lx Ly FgClr [BkgClr] [ClearChar]
  4517.         ClearLine   LineNum ForeGrndClr [BackgrndClr]
  4518.         Color       ForeGroundClr [BackGroundClr]
  4519.         Compare     Value1 Value2 1GR2 [1Less2] [1Eq2]
  4520.         Concat      Target String1 [String2]
  4521.         Cursor      CursorType (1=Normal,2=Off,3=Fat,4=Block)
  4522.         Divide      Result Divisor [RetCode] [Decimals]
  4523.         EnhanClr    Mode
  4524.         GoTo        Label
  4525.         GoToXY      XCo-ord YCo-ord
  4526.         Halt        [ErrorLevel]
  4527.         Label       LabelName
  4528.         Length      StringLength String
  4529.         LocStr      LookFor LookIn [Occur] Loc [Replace]
  4530.         Lower       String
  4531.         MidString   NewString OldString Offset Length
  4532.         Multiply    Result Number [RtnCode] [Decimals]
  4533.         Normal
  4534.         Print       PrinterNum StrToPrint [RtnCode]
  4535.  
  4536.  
  4537.                                     Page 85
  4538.  
  4539.  
  4540.  
  4541.  
  4542.  
  4543.         PrintLine   PrinterNum StrToPrint [RtnCode]
  4544.         PrintScr
  4545.         Prompt      NewPromptVal
  4546.         Random      UpperLimit Result
  4547.         ReadKey     Target [SpecInd] [Timeout] [NoPrt] [CtlChar]
  4548.         ReadStr     Target [Timeout]
  4549.         ReadUpKey   Target [Timeout]
  4550.         ReadYN      Message Target [Timeout] [NoPrt]
  4551.         Reverse
  4552.         ScrMode     Mode
  4553.         SetEnv      EnvironName EnvironValue
  4554.         SetPath     NewPath
  4555.         SetVar      VariableName Value
  4556.         Subtract    Total Number [RtnCode] [Decimals]
  4557.         Trim        StrToTrim [Indicator] [CharToTrim]
  4558.         Upper       VariableName
  4559.         Variable    VariableName MaxLength [InitialValue]
  4560.         Wait        TimeToWait (in tenths of a second)
  4561.         Window0-3   UpX UpY LoX LoY FgClr [BkClr]
  4562.         Window4     UpX UpY LoX LoY FgClr [BkClr] [ShadClr]
  4563.         Write       StringToWrite [ForeClr] [BackClr]
  4564.         WriteAt     XLoc YLoc StringVal [ForeClr] [BackClr]
  4565.         WriteLine   StringToWrite [LineNumber]
  4566.  
  4567.         Standard Variables
  4568.  
  4569.         DispAdapter Current display adapter
  4570.         DOSError Last DOS error code
  4571.         DOSVer      Running DOS version
  4572.         ErrorLevel  Last DOS errorlevel
  4573.         ParallelPorts  Num of parallel ports in running machine
  4574.         SerialPorts Num of serial ports in running machine
  4575.  
  4576.  
  4577.  
  4578.  
  4579.  
  4580.  
  4581.  
  4582.  
  4583.  
  4584.  
  4585.  
  4586.  
  4587.  
  4588.  
  4589.  
  4590.                                     Page 86
  4591.  
  4592.  
  4593.  
  4594.  
  4595.  
  4596.                                Compilation Errors
  4597.  
  4598.         Compilation errors are printed on the screen and also written in a
  4599.         file named ProgName.MAP where ProgName is the name of the program you
  4600.         have just compiled (If you have a split screen editor, view the source
  4601.         in one screen part and the errors in the other part). If the source
  4602.         line is available, the source line is printed above the error preceded
  4603.         by the line number count. Source lines are not available during the
  4604.         second pass of the compiler which may generate "Label not defined" and
  4605.         "Variable not defined" errors.
  4606.  
  4607.               "Not a valid command" - This error is generated when the first
  4608.               word on the command line is not a PowerBatch command and contains
  4609.               more than 8 characters.
  4610.  
  4611.               Example:
  4612.               13 Directory name checked here.
  4613.               [DIRECTORY] Not a valid command
  4614.  
  4615.                                Probably should be
  4616.               ;Directory name checked here
  4617.  
  4618.               "Missing variable" - A command contains less than the required
  4619.               number of operands.
  4620.  
  4621.               Example:
  4622.               21 ?Color   ForeColor,BackColor
  4623.               [] Missing variable
  4624.  
  4625.               Variable for the composite color byte is missing.
  4626.  
  4627.               "Expected a variable Name" - A string was found in an operand that
  4628.               may contain only a variable name.
  4629.  
  4630.               Example:
  4631.               10 ?Time "Current Time"
  4632.               [Current Time] Expected a variable name
  4633.  
  4634.               The current time may only be placed in a variable.
  4635.  
  4636.              "Quoted literal not terminated" - A single quote was encountered
  4637.               within a source line.
  4638.  
  4639.               Example:
  4640.               9 Center "Move Command,5
  4641.  
  4642.  
  4643.                                     Page 87
  4644.  
  4645.  
  4646.  
  4647.  
  4648.  
  4649.                  [] Quoted literal not terminated
  4650.  
  4651.               Closing quote should precede comma.
  4652.  
  4653.               "Invalid max length specified" - The second operand of a variable
  4654.               definition should specify the maximum length of the variable.
  4655.               The value found was not numeric.
  4656.  
  4657.               Example:
  4658.               3 Variable  CompName,"The ABC Company"
  4659.                 [The ABC Company] Invalid max length specified
  4660.  
  4661.              "Variable not defined" - A reference to a variable was made in the
  4662.               source file but the variable was not defined with the Variable
  4663.               command.
  4664.  
  4665.               Example:
  4666.               [CURRDATE] Variable not defined
  4667.  
  4668.               "Duplicate variable" - The same variable name has appeared 2 or
  4669.               more times in a Variable definition statement.
  4670.  
  4671.               Example:
  4672.               7 Variable  CompName,25
  4673.               [COMPNAME] Duplicate variable
  4674.  
  4675.               "Duplicate label" - The same label name has appeared 2 or more
  4676.               times in a Label definition statement.
  4677.  
  4678.               Example:
  4679.               16 Label    Step2
  4680.               [STEP2] Duplicate label
  4681.  
  4682.               "Invalid hex definition in variable" - A variable definition
  4683.               contained a # not enclosed in quotes signifying a value
  4684.               definition by ASCII value. The characters following this # were
  4685.               not numeric or did not equate to an ASCII character.
  4686.  
  4687.               Example:
  4688.               Variable Return,2,#J#219
  4689.  
  4690.                  #J is not valid
  4691.  
  4692.               "External command >" - This is not an error message, but is a
  4693.               check to alert you to each command found in a PowerBatch source
  4694.  
  4695.  
  4696.                                     Page 88
  4697.  
  4698.  
  4699.  
  4700.  
  4701.  
  4702.               file that will be treated as an external command. External
  4703.               commands are DOS intrinsic commands, .COM, and .EXE commands or
  4704.               programs (even PowerBatch compiled programs) and .BAT (standard
  4705.               DOS batch files) that are to be executed by PowerBatch.
  4706.  
  4707.               Example:
  4708.               External command > 12 DIR  (DOS directory command)
  4709.               External command > 29 MYPROG (Exe module MYPROG)
  4710.  
  4711.  
  4712.  
  4713.  
  4714.  
  4715.  
  4716.  
  4717.  
  4718.  
  4719.  
  4720.  
  4721.  
  4722.  
  4723.  
  4724.  
  4725.  
  4726.  
  4727.  
  4728.  
  4729.  
  4730.  
  4731.  
  4732.  
  4733.  
  4734.  
  4735.  
  4736.  
  4737.  
  4738.  
  4739.  
  4740.  
  4741.  
  4742.  
  4743.  
  4744.  
  4745.  
  4746.  
  4747.  
  4748.  
  4749.                                     Page 89
  4750.  
  4751.  
  4752.  
  4753.  
  4754.  
  4755.                                     Examples
  4756.  
  4757.         The source for several examples is contained on your installation
  4758.         disk. You may print these examples by entering:
  4759.  
  4760.            COPY INQUIRE.PWR LPT1
  4761.  
  4762.         These examples may be compiled using the POWERMAK command by entering a
  4763.         command similar to:
  4764.  
  4765.            POWERMAK INQUIRE <enter>
  4766.  
  4767.         This compiles the source for INQUIRE.
  4768.  
  4769.  
  4770.  
  4771.  
  4772.  
  4773.  
  4774.  
  4775.  
  4776.  
  4777.  
  4778.  
  4779.  
  4780.  
  4781.  
  4782.  
  4783.  
  4784.  
  4785.  
  4786.  
  4787.  
  4788.  
  4789.  
  4790.  
  4791.  
  4792.  
  4793.  
  4794.  
  4795.  
  4796.  
  4797.  
  4798.  
  4799.  
  4800.  
  4801.  
  4802.                                          Page 90
  4803.  
  4804.  
  4805.  
  4806.  
  4807.  
  4808.                                IMBEDDED COLOR COMMANDS
  4809.  
  4810.         A literal or a variable may be defined which has color commands
  4811.         imbedded in the text of the literal allowing you to change the color
  4812.         in the middle of the string to be printed. If you were creating a
  4813.         tutorial and wanted a menu at the bottom of the screen that gave the
  4814.         user several command choices and you wanted this menu to have the
  4815.         first character of each command in reverse video, PowerBatch provides a
  4816.         means to accomplish this easily. Suppose the command line is:
  4817.  
  4818.            Next Prev Load ........
  4819.  
  4820.         and the N, P, and L were to be in reverse video you would define the
  4821.         variable (or literal) as:
  4822.  
  4823.            Variable Cmd,75,"@112N@007ext @112P@007rev @112L@007oad"
  4824.  
  4825.         IN THIS EXAMPLE THE @ REPRESENTS CTRL-A BECAUSE OUR PRINTER WILL NOT
  4826.         PRINT A CTRL-A!
  4827.  
  4828.         The syntax for imbedded color commands is Ctrl-A followed by the THREE
  4829.         digit color attribute. Thus @112 means change the color to 112 and
  4830.         continue printing in this color until another change is made. Further
  4831.         examining the line...@112N@007ext means change to color 112, print N,
  4832.         change to color 007, print ext (Next).
  4833.  
  4834.         The ASCII value of Ctrl-A is 001. Most text editors will allow you to
  4835.         enter an ASCII character by entering the actual ASCII value by
  4836.         pressing the Alt key and entering the ASCII value on the numeric
  4837.         keypad (not the numbers above the character keyboard). Thus entering
  4838.         Ctrl-A becomes as simple as pressing Alt-1. 
  4839.  
  4840.  
  4841.  
  4842.  
  4843.  
  4844.  
  4845.  
  4846.  
  4847.  
  4848.  
  4849.  
  4850.  
  4851.  
  4852.  
  4853.  
  4854.  
  4855.                                          Page 91
  4856.  
  4857.  
  4858.  
  4859.  
  4860.  
  4861.                              Composite Color Values
  4862.  
  4863.                              Color Names And Their Values
  4864.  
  4865.         Black (Blk)    0     Dk. Gray (DGy)    8
  4866.         Blue (Blu)     1     Lt. Blue (LBl)    9
  4867.         Green (Grn)    2     Lt. Green(LGr)    10
  4868.         Cyan (Cyn)     3     Lt. Cyan (LCy)    11
  4869.         Red (Red)      4     Lt. Red (Lrd)     12
  4870.         Magenta (Mag)  5     Lt. Magenta (LMg) 13
  4871.         Brown (Brn)    6     Yellow (Yel)      14
  4872.         Lt. Gray (LGy) 7     White (Wht)       15
  4873.  
  4874.         On the following page is two tables which give the ASCII value for the
  4875.         composite color byte (the single byte DOS uses to identify the current
  4876.         color). This single value is a composite of the two values for the
  4877.         background and foreground color values.  To arrive at the composite
  4878.         value multiply the background color value by 16 and add the foreground
  4879.         color value. Some examples will help explain:
  4880.            Red on Blue
  4881.            (Blue * 16) + Red = 20        (001 * 16) + 4 = 20
  4882.  
  4883.            White on Red
  4884.            (Red * 16) + White = 79       (004 * 16) + 15 = 79
  4885.  
  4886.         Verify these composite calculations by finding the corresponding
  4887.         values in the tables on the next page. To find Red on Blue, find the
  4888.         background color down the left side of the table and the foreground
  4889.         color across the top. Blue is the second color down and Red the fifth
  4890.         color across; at this intersection you will find the value 020.
  4891.         (Remember the color values begin with zero). Red is the fifth color
  4892.         down and White is the 16 color across; at this intersection is value
  4893.         079.
  4894.  
  4895.  
  4896.  
  4897.  
  4898.  
  4899.  
  4900.  
  4901.  
  4902.  
  4903.  
  4904.  
  4905.  
  4906.  
  4907.  
  4908.                                          Page 92
  4909.  
  4910.  
  4911.  
  4912.  
  4913.  
  4914.                           Normal (non-blinking) Colors
  4915.  
  4916.  
  4917.             Blk Blu Grn Cyn Red Mag Brn LGy DGy LBl LGr LCy LRd LMg Yel Wht
  4918.         Blk 000 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 
  4919.         Blu 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031
  4920.         Grn 032 033 034 035 036 037 038 039 040 041 042 043 044 045 046 047
  4921.         Cyn 048 049 050 051 052 053 054 055 056 057 058 059 060 061 062 063
  4922.         Red 064 065 066 067 068 069 070 071 072 073 074 075 076 077 078 079
  4923.         Mag 080 081 082 083 084 085 986 087 088 089 090 091 092 093 094 095
  4924.         Brn 096 097 098 099 100 101 102 103 104 105 106 107 108 109 110 111
  4925.         Gry 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
  4926.  
  4927.         Colors Which Blink
  4928.  
  4929.  
  4930.             Blk Blu Grn Cyn Red Mag Brn LGy DGy LBl LGr LCy LRd LMg Yel Wht
  4931.         Blk 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
  4932.         Blu 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
  4933.         Grn 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
  4934.         Cyn 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
  4935.         Red 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
  4936.         Mag 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
  4937.         Brn 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
  4938.         Gry 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
  4939.  
  4940.  
  4941.  
  4942.  
  4943.  
  4944.  
  4945.  
  4946.  
  4947.  
  4948.  
  4949.  
  4950.  
  4951.  
  4952.  
  4953.  
  4954.  
  4955.  
  4956.  
  4957.  
  4958.  
  4959.  
  4960.  
  4961.                                          Page 93
  4962.  
  4963.  
  4964.  
  4965.  
  4966.  
  4967.         Border Color 40                      SetEnv 72
  4968.         Box 34, 35                         SetVar 74
  4969.         Box With Shadow 35                 ERRORLEVEL 13, 52, 84
  4970.         Case                               External Commands 12, 89
  4971.           Lower 56                         Field length
  4972.           Upper 68, 77                       maximum 67
  4973.         CD, ChDir 39                       File exists 25, 26
  4974.         Center A Line Of Text 38           File Size 27
  4975.         Color attribute 16, 17, 59         FileName
  4976.         Command Line Parameters 14, 78       Does It Exist 25
  4977.         Command Notation 15                  Full Path Name 26
  4978.         Command Summary 85                 Flush Keyboard 49
  4979.         Command Syntax 16                  Frame 34, 35
  4980.         Comments 9                         Imbedded Colors 91
  4981.         Compare                            Installation 6
  4982.           alphabetic 44                    Interior of a box 41
  4983.           numeric 44                       Introduction 1
  4984.         Compilation Errors 87              Keyboard Input
  4985.         Composite Color Values 92            ReadKey 65
  4986.         Concatenate Strings 45               ReadStr 67
  4987.         Concept Of Operation 4               ReadUpKey 68
  4988.         Ctrl - Break 36                      ReadYN 69
  4989.         Current Date 19                    Labels 11
  4990.         Current Directory 18               License Agreement 1
  4991.         Current Drive 18                   Literals 9, 10
  4992.         Current Time 29                    Monitor Type 84
  4993.         Cursor Postion 51                  ParallelPorts 84
  4994.         Directory 20                       Passing Parameters
  4995.         Directory Exists 20                  14
  4996.         Directory, Change to new 39        PATH 15
  4997.         Disk capacity 22                     Is Dir In 28
  4998.         Disk Drive                           SetPath 73
  4999.           Valid Letter 23                  Pause 79
  5000.         Disk Space                         Pause A Program 79
  5001.           Free 22                          PowerBatch Commands
  5002.           Total 22                           ?Color 17
  5003.         DOS errorlevel 52                    ?CurrDir 18
  5004.         DOS search path 28                   ?Date 19
  5005.         DOS Version 84                       ?DirExist 20
  5006.         DOSERROR 13, 84                      ?DiskInfo 21
  5007.         Drive Type 21                        ?DiskSpace 22
  5008.         Drive, Change to new 39              ?DriveExist 23
  5009.         Environment Variables 14             ?EnvStr 24
  5010.           Contents 24                        ?FileExist 25
  5011.  
  5012.  
  5013.  
  5014.                                          Page 94
  5015.  
  5016.  
  5017.  
  5018.  
  5019.  
  5020.                                              ?FileExpand 26                                                                        Upper 77
  5021.           ?FileSize 27                       Variable 78
  5022.           ?InPath 28                         Wait 79
  5023.           ?Time 29                           Window 80
  5024.           Add 30                             Write 81
  5025.           Beep 31                            WriteAt 82
  5026.           Blink 32                           WriteLine 83
  5027.           Boot 33                          PROMPT 15
  5028.           Box 34, 35                       Random Numbers 64
  5029.           BreakOff 37                      Screen
  5030.           BreakOn 36                         Clear 40
  5031.           Center 38                          Color 43
  5032.           ChDir 39                         Screen Window 80
  5033.           Clear 40                         SerialPorts 84
  5034.           ClearBox 41                      SETENV 15
  5035.           ClearLine 42                     SETPATH 15
  5036.           Color 43                         Software Support 3
  5037.           Compare 44                       Standard Variables
  5038.           Concat 45                          DispAdapter 84
  5039.           Cursor 46                          DOSError 84
  5040.           Divide 47                          DOSVer 84
  5041.           FlushKey 49                        ErrorLevel 84
  5042.           GoTo 50                            ParallelPorts 84
  5043.           GoToXY 51                          SerialPorts 84
  5044.           Halt 52                          String length 55
  5045.           Label 53                         Syntax
  5046.           Length 55                          Compilation 7
  5047.           Lower 56                         System speaker 31
  5048.           MidString 57                     Time, Current 29
  5049.           Multiply 58                      Trademarks 1
  5050.           Normal 59                        Variable map 7
  5051.           PrintScr 62                      Variables 9
  5052.           Prompt 63                          Value Of 74
  5053.           Random 64                        Virtual Window 80
  5054.           ReadKey 65                       Volume ID 21
  5055.           ReadStr 67                       Window 80
  5056.           ReadUpKey 68                     ReadYN 69
  5057.           Reverse 70
  5058.           ScrMode 71
  5059.           SetEnv 72
  5060.           SetPath 73
  5061.           SetVar 74
  5062.           Subtract 75
  5063.  
  5064.  
  5065.  
  5066.                                          Page 95
  5067.  
  5068.  
  5069.  
  5070.  
  5071.  
  5072.         This page intentionally left blank for your notes...
  5073.  
  5074.  
  5075.  
  5076.  
  5077.  
  5078.  
  5079.  
  5080.  
  5081.  
  5082.  
  5083.  
  5084.  
  5085.  
  5086.  
  5087.  
  5088.  
  5089.  
  5090.  
  5091.  
  5092.  
  5093.  
  5094.  
  5095.  
  5096.  
  5097.  
  5098.  
  5099.  
  5100.  
  5101.  
  5102.  
  5103.  
  5104.  
  5105.  
  5106.  
  5107.  
  5108.  
  5109.  
  5110.  
  5111.  
  5112.  
  5113.  
  5114.  
  5115.  
  5116.  
  5117.  
  5118.  
  5119.                                          Page 96
  5120.